Re: Finding rows older than one hour
| From: | Maxwell Hung | Date: | Wed, 28 Jun 2000 10:36:42 +0000 |
| Subject: | Re: Finding rows older than one hour | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-682@lists.php.net to get a copy of this message | ||
I am getting this error for that select
MySQL said: parse error near '(NOW(), INTERVAL 1
HOUR)' at line 1
I am using mysql ver 3.21.29
Thanks
--- php3@developersdesk.com wrote: > 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
__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/