old news SQL help needed
| From: | Larry Linthicum | Date: | Sun, 30 Sep 2001 01:26:23 +0000 |
| Subject: | old news SQL help needed | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-12844@lists.php.net to get a copy of this message | ||
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