02-08-2008, 04:28 PM
|
#5 (permalink)
|
|
The Addict
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
|
Yeah, I was digging in my MySQL reference book, since Srev got me interested, and I think this would be a better method:
sql Code:
SELECT * FROM `my_table` WHERE TIMESTAMPDIFF(HOUR, `access`, TIME()) <= 24;
That makes it a whole lot simpler than what I thought of before. However it does require MySQL 5.0 and upwards.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
|
|
|
|