hi all
I m working in admin section.
There i have order details rows. i have a option of deleting the record on clicking the delete button with each row.
Everytime when i click delete button it deletes the record that is on no.1 not the particular record that i selected. whether i select the delete button at row 5 then also it deletes the record of row 1.
this the 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);
$order_id=$row_del['order_id'];
$product_name=$row_del['product_name'];
//echo "test". $row_del['order_id'];
$qry_del="DELETE from order_detail_table where where order_id='$order_id' AND product_name='$product_name'";
echo $qry_del;
if(mysql_query($qry_del))
{
$msg="item deleted success";
}
else
{
$msg="item not deleted";
}
}
?>
Like i have product name nokia on no.1 and samsung on no.3.
when i echo the result after clicking delete button on samsung i get
<?php
DELETE from order_detail_table where order_id='67' AND product_name='nokia'
?>
the result should be product name"samsung" when clicked samsung delete buton.
vineet