Wrox Programmer Forums
|
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 14th, 2004, 03:26 PM
Authorized User
 
Join Date: Dec 2003
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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!

 
Old September 14th, 2004, 03:56 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Your column names are in quotes. They need to be in ticks or surrounded by nothing.

HTH

-Snib <><
http://www.snibworks.com/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Job mani_he Linux 4 December 16th, 2010 07:02 AM
Cron Jobs - Execute File itHighway Beginning PHP 0 November 20th, 2005 10:52 PM
Cron Job Error - Need Help jkirkpatrick Linux 2 August 5th, 2005 05:51 AM
DTS Scheduled Jobs Errors in DB (Misc) Walden SQL Server DTS 1 March 9th, 2004 08:13 AM
DTS Scheduled Jobs Errors in DB Walden SQL Server DTS 1 March 8th, 2004 11:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.