ok so i have a form where all the user needs to type in is a quantity but now here is what i am finding hard the form is being submited perfectly but how do i get it so that the product and the cost are also submited?
here is my code for my form:
$store_sql = mysql_query("SELECT * FROM `stores` WHERE `location`='$cur_position'")or die(mysql_error());
if($store_sql)
{
echo "<form method=\"post\" action=\"buy.php\">";
echo "<table bgcolor=green border=1 style=\"color: #000022;\">";
while($store_info=mysql_fetch_array($store_sql))
{
$store = $store_info['name'];
$product = $store_info['product'];
$cost = "\$".$store_info['cost'];
echo "<tr><th colspan=3>".$store."</th></tr>";
echo "<tr bgcolor=green>";
echo "<td width=100px>";
echo $product;
echo "</td>";
echo "<td>";
echo $cost."/ea";
echo "</td>";
echo "<td>";
echo "<input type=\"text\" size=\"1\" name=\"ammount\" maxlength=\"6\">";
}
echo "</tr>";
echo "<tr>";
echo "<td colspan=3 align=right>";
echo "<input type=\"submit\" value=\"buy\">";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</form>";
?>
I only want to use one field but i want it so that the user can buy multiple different products at once. I don't know if there is somthing that I can add so that the textbox is attached to the row id in the database.
There is probably a simple way of doing this but i can't think of what it would be.
Thanks for the help in advance.