Re: mysql query on timestamp
| From: | php3 at developersdesk dot com | Date: | Thu, 14 Sep 2000 04:07:31 +0000 |
| Subject: | Re: mysql query on timestamp | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-16682@lists.php.net to get a copy of this message | ||
Addressed to: Richard Kurth <rkurth@pacifier.com>
php-general@lists.php.net
** Reply to note from Richard Kurth <rkurth@pacifier.com> Wed, 13 Sep 2000 19:14:38 -0700
>
> How can I search a mysql database every 15 min using timestamp to see if
> there is a new entry. I will be running this at root using cron and php
> compiled as a cgi on a Linux box. What I need is the query statement to
> do this
>
SELECT whatever,
FROM wherever
WHERE timestamp > SUBDATE( NOW() INTERVAL 15 MINUTES );
NOTE: timestamp is a MySQL data type, and does not make a good field name, I
just used it in the example above because you used it in the question. You
should pick a different field name.
For more info see:
http://www.mysql.com/documentation/mysql/commented/manual.php?section=Date_an
Rick Widmer
Internet Marketing Specialists
www.developersdesk.com