Jump to content

[SOLVED] DATE_SUB problem


Eiolon

Recommended Posts

I am trying to query for a code and want it to return a result only if it was used within the last 30 minutes.

 

mysql> SELECT code, last_used FROM codes WHERE code = '234-246-248' AND DATE_SUB(CURDATE(),INTERVAL 30 MINUTE) <= last_used;
+-------------+---------------------+
| code        | last_used           |
+-------------+---------------------+
| 234-246-248 | 2009-03-13 06:46:05 |
+-------------+---------------------+
1 row in set (0.00 sec)

 

It's been well over an hour since the code was last used but it is still returning a result.  Any clues?

Link to comment
https://forums.phpfreaks.com/topic/149250-solved-date_sub-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.