Good day guys =) ..., i know there are somewhat similar threads of this around here but i still cant find the one to solve my problem ... well i am currently building an online store.. and in this online store there's a table of products with the an image, id and name ... beside the list of images is a checkbox which a customer is supposed to check if she is interested with the item now this table is connected to a form wherein the customer is supposed to enter her name, contact info and address... my problem is i would like to store this info (name,contact,address, and the value of the checked boxes) altogether in the database allowing multiple boxes to be checked...
my database contains:
id, name,contact,address,order...
here's my code
<?php
$name = $_POST['name'];
$address = $_POST['address'];
$phone = $_POST['phone'];
$orders = $_POST['orders'];
mysql_connect("localhost", "root","") or die ('Error: '. mysql_error());
mysql_select_db("store");
$query="INSERT INTO orders (id, name, address, phone, custorder) VALUES ('NULL','".$name."','".$address."','".$phone."','".$orders."' )";
mysql_query($query) or die ('Error Updating the Database' . mysql_errno());
echo "Order Successfully Placed";
?>
it already stores data in the database but only one order is stored even if i check multiple check boxes