PHP_Mysql <select> problem?
Hi all, i'm new to PHP and i don't know if i can ask questions here or not
but i have a little store
i want in the databse to store the avilable amount of a product, and list it in a <select> statemnet, when the user choose from the select list , the number is stored in the databse so that i can retrieve it later.
i want this process to repeat for all the products i have
i started a code , but i couldn't know how to store the selection that the user choose
<?php
mysql_connect("localhost");
mysql_select_db("db");
$sql = "SELECT * FROM store";
$rs = mysql_query($sql);
while($row = mysql_fetch_array($rs))
{
$p = $row[p];
$av = $row[av];
$price = $row[price];
echo "<tr>
<td>$p</td>
<td><select name=".$choice.">";
for($i=0; $i<=$avilable; $i++)
{
echo "<option value=".$i." name=".$i.">$i</option>";
}
echo "<td >$price</td>
</tr>";
}
mysql_close();
?>
after that when i click submit i want a page that prints out for every product the amount that the user choose + the price and the total price
i hope you can help me