Hi,
I have a form (sample image: www.ahamay.com/sort.htm ) that has a sort column in it. I need to find out how to pass the values of the sort column to the database once the ‘Update record’ button is clicked. My problem is that my very limited knowledge of PHP is stopping me understand how to pass the multiple ‘sort’ values to the following string:
$updateSQL = sprintf("UPDATE compositions_solo
SET sort=%s
WHERE solo_ID=%s",
GetSQLValueString($_POST['sort']),
GetSQLValueString($_POST['soloid']));
I guess I need some kind of array but I’m really unsure as to where to find out how to do this. I have read and read up on this but nothing points me to the solution. Can anyone help/show/point me in beginners language as to what I need to do.
I know I need to pass something like the following but as I say I’m stuck with not knowing what syntax to use.
UPDATE compositions_solo
SET sort=5, 3, 2, 4
WHERE solo_ID=14, 12, 15, 16
The code below is a snip of what I’m using to return the values in the www.ahamay.com/sort.htm sample.
mysql_select_db($database_*****, $****);
$query_GetSolo_Inst = "SELECT * FROM compositions_solo";
$GetSolo_Inst = mysql_query($query_GetSolo_Inst, $****) or die(mysql_error());
$row_GetSolo_Inst = mysql_fetch_assoc($GetSolo_Inst);
$totalRows_GetSolo_Inst = mysql_num_rows($GetSolo_Inst);
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<?php do { ?>
<?php echo $row_GetSolo_Inst['Solo_Title']; ?>
<? $sorte = array($row_GetSolo_Inst['sort']);
<input type="text" name="sort" value="<?php echo $sorte[0]; ?>" size="5">
<? $soloID = array($row_GetSolo_Inst['solo_ID']); ?>
<input type="hidden" name="soloid" value="<?php echo $soloID[0]; ?>">
<?php } while ($row_GetSolo_Inst = mysql_fetch_assoc($GetSolo_Inst)); ?>
<input type="submit" value="Update record">
<input type="hidden" name="MM_update" value="form1">
</form>
Thanks very much