RE: [PHP-DB] PHP, dates, and MySQL data comparisons
| From: | John W. Holmes | Date: | Wed, 02 Oct 2002 05:21:31 +0000 |
| Subject: | RE: [PHP-DB] PHP, dates, and MySQL data comparisons | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-22148@lists.php.net to get a copy of this message | ||
> I have a table with a Date field (yyyy-mm-dd) and I would like to
retrieve
> all rows with the date less than one week ago.
>
> Something like.... SELECT FROM table WHERE date > one_week_ago_today.
SELECT * FROM table WHERE date > NOW() - INTERVAL 7 DAY;
---John Holmes...