hi i want to update or insert to my exit db that have patient id and staff_id
i make lke this for my form :
<table class="table">
<form action="cheekbox.php" method="post">
<tr>
<th class="th">ORDER_DESC </th>
</tr>
<tr>
<td class="td"><input type="checkbox" name="checkbox[]" value="CSF"/> CSF </td>
</tr>
<tr>
<td class="td"><input type="checkbox" name="checkbox[]" value="LFT"/> LFT </td>
</tr>
<tr>
<td class="td"><input type="checkbox" name="checkbox[]" value="RFR"/> RFR </td>
</tr>
<tr>
<td class="td" ><input type="submit" value="Submit" name="Submit"/>
</td>
</tr>
</form>
</table>
and for php :
<?php
$orders = $_POST['checkbox'];
mysql_connect("localhost", "root","") or die ('Error: '. mysql_error());
mysql_select_db("project");
if(count($orders)>0)
{
foreach($orders as $key=>$order)
{
$query="INSERT INTO orders (ORDER_DESC) VALUES ('".$order."' ) SELECT staff_id , pat_id FROM orders ";
mysql_query($query) or die ('Error Updating the Database' . mysql_errno());
}
echo "Order Successfully Placed";
}
else
echo "No Orders";
?>