Try this instead: Delete league_news FROM leagues where news_date + interval 7 day <= now();
Sheridan Saint-Michel Website Administrator FoxJet, an ITW Company www.foxjet.com ----- Original Message ----- From: "Larry Linthicum" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, September 29, 2001 8:26 PM Subject: [PHP-DB] old news SQL help needed > I have a MySql table for news on the site > the date the news is inserted goes in column news_date > the text of the news itself, goes in column league_news > > > I want to DELETE all news older than 7 days > I looked in the MySql documentation at the date functions and tried the > following but it produced an error ...help? > > > Delete league_news > FROM leagues > WHERE TO_DAYS(NOW()) - TO_DAYS(news_date) >= 7 > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]