Re: Finding rows older than one hour
| From: | php3 at developersdesk dot com | Date: | Wed, 28 Jun 2000 10:49:01 +0000 |
| Subject: | Re: Finding rows older than one hour | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-679@lists.php.net to get a copy of this message | ||
Addressed to: =?iso-8859-1?q?Maxwell=20Hung?= <maxwell_hung@yahoo.com>
php-db@lists.php.net
** Reply to note from =?iso-8859-1?q?Maxwell=20Hung?= <maxwell_hung@yahoo.com> Wed, 28 Jun
2000 02:21:09 -0700 (PDT)
>
> I have a column in a table that is a timestamp field. How can I find
> columns that are older than one hour? I've looked in the manuals but
> most of the examples use date/time fields.
>
A timestamp field is just a datetime field with the additional property
that the first one in your table is automagically updated each time any
other fields in your row are updated.
so...
WHERE your_timestamp < SUBDATE( NOW(), INTERVAL 1 HOUR )
should work. (At least for MySQL.)
Rick Widmer
Internet Marketing Specialists
www.developersdesk.com