| List: | General Discussion | « Previous MessageNext Message » | |
| From: | sono-io | Date: | June 19 2011 5:53pm |
| Subject: | SELECT records less than 15 minutes old | ||
| View as plain text | |||
Hi, I'm trying to write a statement that will return all records that match a particular order_id and that have a timestamp within the last 15 minutes. I thought that this should work: SELECT * FROM `records` WHERE `order_id` = $order_id AND (`time_stamp` >= DATE_SUB(NOW(), INTERVAL 15 MINUTE)) but it returns zero rows, no matter what. If I up the interval to something huge, like 15000, it will then return records. Very strange. It's almost like it's using seconds, not minutes. Is my syntax wrong? Thanks, Marc
| Thread | ||
|---|---|---|
| • SELECT records less than 15 minutes old | sono-io | 19 Jun |
| • Re: SELECT records less than 15 minutes old | Claudio Nanni | 19 Jun |
| • Re: SELECT records less than 15 minutes old | sono-io | 19 Jun |
| • Re: SELECT records less than 15 minutes old | walter harms | 20 Jun |
| • RE: SELECT records less than 15 minutes old | Jerry Schwartz | 20 Jun |
| • Re: SELECT records less than 15 minutes old | sono-io | 21 Jun |
| • Re: SELECT records less than 15 minutes old | walter harms | 21 Jun |
| • RE: SELECT records less than 15 minutes old | Jerry Schwartz | 21 Jun |
