Hello,
I'm trying to delete the cart older than 1 hour with the following query:
$sql = "DELETE psez_cart_product FROM psez_cart_product JOIN psez_cart ON psez_cart.id_cart = psez_cart_product.id_cart WHERE DATE(psez_cart.date_add) < DATE_SUB( NOW( ) , INTERVAL 1 HOUR)";
and
$sql = "DELETE FROM psez_cart WHERE DATE(psez_cart.date_add) < DATE_SUB( NOW( ) , INTERVAL 1 HOUR)";
but the condition doesn't work, it is always executed.
What am I doing wrong?
Thank you!