Farcell
Member
Hi there, I want to delete old archived customer records from my database automatically which have been there for more than 7 days. So, I started with a cron job which runs once a day and I tried the PHP script below
Can you tell me where I went wrong?
Code:
$myDb->setQuery("DELETE FROM `customer` WHERE `customer_archive` = '1' AND `delivery_date` < DATE_SUB(NOW(), INTERVAL 7 DAY)");
$myDb->execute();
Can you tell me where I went wrong?
Last edited: