problem deleting particular row record
hi all
i am working in admin section to manage records. There i have records from serial no.38 to 43. I have a option to delete each single record with delete button provided with each single record. The problem i m getting in deleting is
1) when i click delete buton at record no.38 then the record no.43 gets deleted.
2) Then again when i click delete buton at record no.39 then the record no.41 gets deleted.
this the code
Code:
<?php
if(isset($_REQUEST['del_item_x']))
{
$qry_del="select * from order_detail_table";
$result_del=mysql_query($qry_del);
//$row_del=mysql_fetch_array($result_del);
while($row_del=mysql_fetch_array($result_del))
{
$serial=$row_del['serial'];
$order_id=$row_del['order_id'];
$product_name=$row_del['product_name'];
//echo $serial;
//echo "test". $row_del['order_id'];
}
$qry_del="DELETE from order_detail_table where order_id=$order_id AND serial='$serial'";
echo $qry_del;
if(mysql_query($qry_del))
{
$msg="item deleted success";
}
else
{
$msg="item not deleted";
}
}
?>
vineet