Well i'm not what you can call an expert but what i see...
You are getting the serial number with the while statement
PHP Code:
$qry_del="select * from order_detail_table";
$result_del=mysql_query($qry_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'];
}
so of course you are gonna get as $serial the last record, so when you are deleting you will be deleting the last.
You should pass the serial or id from the form and then just do the delete.
PHP Code:
$qry_del="DELETE from order_detail_table where order_id=$order_id AND serial='$serial'";
if(mysql_query($qry_del))
{
$msg="item deleted success";
}
else
{
$msg="item not deleted";
}
I hope it helps, i'm just a newbie
Bookmarks