Passing Multiple values
Posted: Fri Oct 19, 2007 1:17 pm
Hi,
I’m looking for some pointers with the following PHP that has me stuck. Basically I want to pass the values of an array from my form to my database so that I can update a ‘sort’ column in a specific numeric order.
If I run this
I get exactly what I need in the browser window but my problem is that I want to then pass this to the following so that I can update all the detail from the form above in one go.
I can see that when I run this I get
UPDATE compositions_solo SET sort=NULL WHERE solo_ID=NULL and my limited PHP knowledge is challenged now as I can’t see how to pass more than one value to the database using the above.
Can anyone give me a few pointes as to how I can pass the values of my array to the respective columns in the database?
Thanks for any help
B
I’m looking for some pointers with the following PHP that has me stuck. Basically I want to pass the values of an array from my form to my database so that I can update a ‘sort’ column in a specific numeric order.
If I run this
Code: Select all
<?php do { ?>
<?php echo $row_GetSolo_Inst['Solo_Title']; ?>
<? $sorte = array($row_GetSolo_Inst['sort']); ?>
<input type="text" name="<?php $sorte[0]; ?>" value="<?php echo $sorte[0]; ?>" size="5">
<? $soloID = array($row_GetSolo_Inst['solo_ID']); ?>
<input type="hidden" name="<?php echo $soloID[0]; ?>" value="<?php echo $soloID[0]; ?>">
<?php } while ($row_GetSolo_Inst = mysql_fetch_assoc($GetSolo_Inst)); ?>
<input type="submit" value="Update record">Code: Select all
$updateSQL = sprintf("UPDATE compositions_solo SET sort=%s WHERE solo_ID=%s",
GetSQLValueString("$sorte[0]", "int"),
GetSQLValueString("$soloID[0]", "int"));UPDATE compositions_solo SET sort=NULL WHERE solo_ID=NULL and my limited PHP knowledge is challenged now as I can’t see how to pass more than one value to the database using the above.
Can anyone give me a few pointes as to how I can pass the values of my array to the respective columns in the database?
Thanks for any help
B