php-db | 2001011
Date: 01/03/01
- Next message: Miles Thompson: "Re: [PHP-DB] Interbase 5.6 error and php 4.0.4"
- Previous message: Paulo Berti - Americanflex: "[PHP-DB] PHP with MySQL"
- In reply to: Lynn Siprelle: "[PHP-DB] Time comparison"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>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>
- Next message: Miles Thompson: "Re: [PHP-DB] Interbase 5.6 error and php 4.0.4"
- Previous message: Paulo Berti - Americanflex: "[PHP-DB] PHP with MySQL"
- In reply to: Lynn Siprelle: "[PHP-DB] Time comparison"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

