DB cron jobs
I would like to delete all the records from my database that are over 14 days old and still pending status. The (faulty) sql I have is:
DELETE registration WHERE 'status' = "pending" AND 'reg_date' > DATE_SUB( CURDATE( ) , INTERVAL 14 DAY )
When I try to run this in phpmyadmin I get and error:
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `status` = "pending" AND reg_date > DATE_SUB( CURDATE(
Can anyone helpme and tell me what is wrong with my code? My web service provider has a "Standard Cron Manager" control panel that allows me to schedule commands to run. Do I need to put this in a php file to run it? How do I call a php file as a command?
Thnx!
|