I am trying to create a form where each line is pulled from a MySQL database with an column for ordered amount. Then when the user hits the submit button, it enters in that data into a new table of the MySQL database and sends an e-mail. I am just trying to create the first page so far. Here is what I have done so far:
<FORM ACTION=\"misc_order_submit.php\" METHOD=POST>
<TABLE BORDER=\"0\">
<TR>
<TD width=\"200\"><center><b><u>Description</u></b></center></TD>
<TD width=\"20\"><center><b><u>Min</u></b></center></TD>
<TD width=\"20\"><center><b><u>Max</u></b></center></TD>
<TD width=\"40\"><center><b><u>Pkge Qty</u></b></center></TD>
<TD width=\"40\"><center><b><u>Order</u></b></center></TD>
</TR>";
while (($row=mysql_fetch_array($result))):
$id=$row["id"];
$sku=$row["sku"];
$description=$row["description"];
$vpc=$row["vpc"];
$package_qty=$row["package_qty"];
$location=$row["location"];
$min=$row["min"];
$max=$row["max"];
<TR>
<TD>";
print $description;
echo "</TD>
<TD>";
print $min;
echo "</TD>
<TD>";
print $max;
echo "</TD>
<TD>";
print $package_qty;
echo "</TD>
<TD><input name=\"order[$id]\" type=text></TD>
</TR>";
endwhile
?>
<TR>
<TD colspan="5"> <input type=submit></TD></TR>
</TABLE>
</FORM>
I imagine I am incorrect in how the array is working. How do I make sure that the ordered amount ($order) stays with the correct $id when I insert into the database?
Thanks for any help you can offer me.
Jeff