I am doing a shopping cart (still!) and have a ThankYou.php which sends out details of the order to the shop.
That part works!!
At the end of this, I want to delete the items (rows) from the database and the cookie.
However, the code below gives:
outSIDE Delete failed.
Any ideas, please?
I really appreciate all the help that I have had with this cart and this is just about the last problem to solve!
Thanks.
That part works!!
At the end of this, I want to delete the items (rows) from the database and the cookie.
However, the code below gives:
outSIDE Delete failed.
Any ideas, please?
I really appreciate all the help that I have had with this cart and this is just about the last problem to solve!
Thanks.
Code:
echo "outSIDE";
$result = mysql_query("delete from cart where cookieId = '" . GetCartId() . "' and cartId = $cartId",$con);
echo $result;
//checks query result
if ($result === false) die("Delete failed.");
while($row = mysql_fetch_row($result)){
$res=mysql_query($result) or die(mysql_error());
echo $res;
}
//delete cookie
setcookie("cartId", session_id(), time() - 9999);
setcookie("cartId", session_id());
setcookie("cartId");