I want to know how to make an array of the selected items from multiple select menus. I have an order form that looks like this. The product names have a quantity menu beside it,(assuming there is already a quantity menu until the last product name) I want to get the selected quantities and insert them to a ‘quantity’ field in the database separated by “,” just like what you do in checkboxes.
[ATTACH]16501[/ATTACH]
my PHP so far. I only have the array for the checkboxes(product names). I don’t know how to make an array for the quantities/select menus.
[code=php]<?php
include (“dbinfo.php”);
if (isset($_POST[‘button’]))
{
$implode = implode(“,”,$_POST[‘CheckboxGroup’]);
mysql_query(“INSERT INTO order_form (orders) VALUES (‘”.$implode.”‘)”) ;
}
?>
<?php
if(isset($_POST[‘button’]))
{
$implode = implode(“,”,$_POST[‘CheckboxGroup’]);
mysql_query(“INSERT INTO order_form (name, address, contact_no, payment_option, claim_option, orders) VALUES (‘”.$_POST[‘name’].”‘, ‘”.$_POST[‘address’].”‘, ‘”.$_POST[‘contactno’].”‘, ‘”.$_POST[‘pay_option’].”‘, ‘”.$_POST[‘claim_option’].”‘, ‘”.$implode.”‘)”);
}
?>
[canned-message]attachments-removed-during-migration