Re: Time comparison

From: Date: Wed, 03 Jan 2001 03:08:52 +0000
Subject: Re: Time comparison
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-5544@lists.php.net to get a copy of this message
At 8:36 PM -0800 12/30/00, Lynn Siprelle wrote:
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?
... WHERE date_col >= DATE_SUB(NOW(), INTERVAL 1 DAY) -- Paul DuBois, paul@snake.net

« previous php.db (#5544) next »