I want to be able to update my database table by using a sort order where I can arrange the order of a list by using numbers. I have no problem in querying the database and retuning the values using the following script.
Code: Select all
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table align="center">
<tr valign="baseline">
<td>Solo Title:</td>
<td>Sort:</td>
</tr>
<?php do { ?>
<tr valign="baseline">
<td><?php echo $row_GetSolo_Inst['Solo_Title']; ?></td>
<td><input type="text" name="sort" value="<?php echo $row_GetSolo_Inst['sort']; ?>" size="10"></td>
</tr>
<input type="hidden" name="solo_ID" value="<?php echo $row_GetSolo_Inst['solo_ID']; ?>">
<?php } while ($row_GetSolo_Inst = mysql_fetch_assoc($GetSolo_Inst)); ?>
<tr valign="baseline">
<td><input type="submit" value="Update record"></td>
<td> </td>
</tr>
</table>
<input type="hidden" name="MM_update" value="form1">
</form>Code: Select all
$updateSQL = sprintf("UPDATE compositions_solo SET sort=%s WHERE solo_ID=%s",
GetSQLValueString($_POST['sort'], "int"),
GetSQLValueString($_POST['solo_ID'], "int"));
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table align="center">
<tr valign="baseline">
<td>Solo Title:</td>
<td>Sort:</td>
</tr>
<tr valign="baseline">
<td><?php echo $row_GetSolo_Inst['Solo_Title']; ?></td>
<td><input type="text" name="sort" value="<?php echo $row_GetSolo_Inst['sort']; ?>" size="10"></td>
</tr>
<input type="hidden" name="solo_ID" value="<?php echo $row_GetSolo_Inst['solo_ID']; ?>">
<tr valign="baseline">
<td><input type="submit" value="Update record"></td>
<td> </td>
</tr>
</table>
<input type="hidden" name="MM_update" value="form1">
</form>This is a print out of the first code above incase it’s of any value.
Thanks a mil
Code: Select all
<form method="post" name="form1" action=”self.php">
Voces Críticas (2004) <input type="text" name="sort" value="6" size="10">
<input type="hidden" name="solo_ID" value="7
Canción y Tango (2004) <input type="text" name="sort" value="6" size="10">
<input type="hidden" name="solo_ID" value="8">
Twelve Études (2004) <input type="text" name="sort" value="8" size="10">
<input type="hidden" name="solo_ID" value="9">
<input type="submit" value="Update record">
<input type="hidden" name="MM_update" value="form1">
</form>