Crazy problem with Delete statement
Posted: Mon Aug 11, 2003 10:55 am
I'm executing a block of code and what I want to do is basically if the variable matches my check I want to delete the record and display a msg. So I run a delete query and then and echo statement.
The problem is the echo statement NEVER appears unless I comment out the sql call. The record gets deleted so I know its hitting this loop correctly but the echo NEVER works. crazy.
Anyone have any thoughts?
The problem is the echo statement NEVER appears unless I comment out the sql call. The record gets deleted so I know its hitting this loop correctly but the echo NEVER works. crazy.
Anyone have any thoughts?
Code: Select all
<?php
if($prod_1 == 5702 || $prod_2 == 5702)
{
$result3 = query_db("SELECT * FROM shopping_cart WHERE session_id = '".$_COOKIE['cart_id']."' AND product_id = 5702");
$num_row3 = @mysql_num_rows($result3);
if($num_row3 > 0)
{
echo '<BR><BR><B><font color="red">You have already used the Bergger sample promotion for item# 237281</font></B><BR>';
$result4 = query_db("DELETE FROM shopping_cart WHERE session_id = '".$_COOKIE['cart_id']."' AND product_id = 5702");
}
}
?>