hi guys
im beginning in php
im using dream waver and php my admin
i have problem for insert when in insert it give me two record i want to be in same record to insert
for my form :
<table class="table">
<form action="11.php" method="post" name="form2">
<input type='hidden' name="ORDER_DESC" id='hidden' />
<tr>
<td width>ORDER DESCRIPTION:</td>
</tr>
<tr>
<td class="td"><input type="checkbox" name="checkbox[]" id="checkbox[]" value="CSF"/> CSF </td>
</tr>
<tr>
<td class="td"><input type="checkbox" name="checkbox[]" id="checkbox[]" value="LFT"/> LFT </td>
</tr>
<tr>
<td class="td"><input type="checkbox" name="checkbox[]" id="checkbox[]" value="RFR"/> RFR </td>
</tr>
<tr>
<td class="td"><input type="checkbox" name="checkbox[]" id="checkbox[]" value="TFT"/> TFT </td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Submit" id="Submit">
</td>
</tr>
</form>
</table>
i write like this of my php :
<?php
include("config.php");
$orders = $_POST['checkbox'];
$result = mysql_query ("SELECT orders.staff_id FROM orders
WHERE orders.staff_id = (SELECT staffs.staff_id FROM staffs
WHERE staffs.staff_id = '1000')");
if(count($orders)>0)
{
foreach($orders as $key=>$order)
{
$query="INSERT INTO orders (ORDER_DESC) VALUES ('".$order."' )";
mysql_query($query) or die ('Error Updating the Database' . mysql_errno());
}
echo "Order Successfully Placed";
}
else
echo "No Orders";
?>
can any body help ?