Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2001011

Re: [PHP-DB] Time comparison From: Bob Hall (rjhalljr <email protected>)
Date: 01/03/01

>Hi guys--
>
>Sorry to bother you with what is probably a simple question. I've
>read through the manual and I'm still not sure of what I'm doing;
>I'm getting caught in strings vs. numbers, ie, I'm afraid that what
>I'm trying to do won't work because I'm dealing with strings instead
>of numbers.
>
>I'm trying to pull rows out of a MySQL table where the date stamp looks like:
>
>2000-12-30 19:22:00
>
>I want to pull all rows that have been placed in the db in the last
>24 hours. How can I compare the current date/time to the date stamps
>in the table?

Ma'am, try
    WHERE datetime > Date_sub(Now(), INTERVAL 1 day)
Instead of '1 day' you could use '24 hour'.

Bob Hall

Know thyself? Absurd direction!
Bubbles bear no introspection. -Khushhal Khan Khatak

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>