I'm doing a basket of a shop and I don't know how to modify the number of products that are in the basket if the user change the number of someone.
The problem is that when the user modify the number of units of a product I don't know which product has been modified (first,second,third...) and I can't update the database table where are the products stored.
I have been typing the following lines but they don't work:
$qry4=mysql_query("select numprodorders from orders where idpub='$rw[idprod]'"
;
$rw4=mysql_fetch_array($qry4);
echo "<td align=\"center\" bgcolor=\"#ccddee\"><input type=\"text\" name=\"cant[]\" size=\"2\" value=\"$rw4[numprodorders]\"></td>";
The lines of above are for showing the products that are in the basket, the following are the lines for the button Update that is to update the number of product units:
echo "<form method=\"post\" action=\"main.php?name=Shop&file=update\";";
echo " <td align=center>";
echo " <input type=\"submit\" name=\"update\" value=\"Update\">";
echo " </td>";
I would like how to solve this problem.
Thank you.
The problem is that when the user modify the number of units of a product I don't know which product has been modified (first,second,third...) and I can't update the database table where are the products stored.
I have been typing the following lines but they don't work:
$qry4=mysql_query("select numprodorders from orders where idpub='$rw[idprod]'"
$rw4=mysql_fetch_array($qry4);
echo "<td align=\"center\" bgcolor=\"#ccddee\"><input type=\"text\" name=\"cant[]\" size=\"2\" value=\"$rw4[numprodorders]\"></td>";
The lines of above are for showing the products that are in the basket, the following are the lines for the button Update that is to update the number of product units:
echo "<form method=\"post\" action=\"main.php?name=Shop&file=update\";";
echo " <td align=center>";
echo " <input type=\"submit\" name=\"update\" value=\"Update\">";
echo " </td>";
I would like how to solve this problem.
Thank you.