I have code that reads data from a database, then displays them (from an array). The displayed data is within a form and I want the user to be able to delete items from the listed items using a checkbox and also change quantity for each item.
The problem is that when you click the submission button, only the last record is sent. I need to find a way to store the submitted form values and store them in an array. Here is a snippet of the code that I'm using
$GetQuery = "SELECT * FROM table";
$GetInfo = mysql_query($GetQuery);
while ($p = mysql_fetch_row($GetInfo))
{
?>
<tr>
<form action="index.php?show=info" method="post">
<td align="center">
// $p[0] is a unique number to the item stored in the dbase
<input type="hidden" name="LineID[]" value="<?php echo $p[0]; ?>">
<input type="checkbox" name="DeleteInfo" value="DELETE">
</td>
<td>
<input type="text" name="Quantity" value="<?php echo $p[6]; ?>" size="2">
</td>
</tr>
<?php
}
?>
</form>
The next page will delete or change the data based on the return value of LineID.
What are your thoughts??