Re: compare 2 dates in mysql query
| From: | CPT John W. Holmes | Date: | Tue, 15 Apr 2003 17:27:21 +0000 |
| Subject: | Re: compare 2 dates in mysql query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143987@lists.php.net to get a copy of this message | ||
> i have a query that deletes records in a mysql table it goes like this:
> delete post if timestamp on post is 14 days old or older (using current
date
> to determine wether the post is 14 days old or not)
> i dont even know how to make the query right...
DELETE FROM table WHERE column < CURDATE() - INTERVAL 14 DAY;
---John Holmes...