With this (testing) code I create a form to update prices in my database. (colums: id, omschrijving, prijs). The textboxes have the same id as the id-number in the database.
I would like to receive some help to write the update query. The query must handle all the id's, not row by row (id1 = field1, id2 =field2 etc), because the number of items is changing in the coming time.
I'm just a beginner, any help would be highly appriciated.
<?php
include 'connect.php';
$query = 'SELECT * FROM prijzen';
$sql = mysql_query($query) or die ( mysql_error( ) );
echo'<form method="POST" action="test3.php"><table width="100%" border="0">' ;
while($record = mysql_fetch_object($sql)){
echo'<tr><td>'.$record->omschrijving.'</td><td>€ <input type="text" name="'.$record->id.'" size="6" value="'.$record->prijs.'"></td></tr>';
}
echo'</table><p><input type="submit" value="send" ></form>';
?>