i have a code which allows the user to select multiple check-boxes.
while($data2=mysql_fetch_array($result))
{
echo "<input type=\"checkbox\" name=\"pid[]\" value=\"{$data2['product_id']}\"> {$data2['product_id']} {$data2['product_name']}</option>";
echo"<br/>";
}
i want to enter the checked values in database.
$pid=$_POST['pid'];
for ($i=0;$i<count($pid);$i++)
{
$information="INSERT INTO orders(productid,product_discount,amount,customerid,order_date,quantity) VALUES('$pid','$discount','$amount','$custid',CURDATE(),'')";
$result=mysql_query($information) or die(mysql_error());
}
this is not working.please help/