lynxus Posted June 1, 2009 Share Posted June 1, 2009 Hi guys, I have a db with a bunch of stuff in a table with timestamps. ie: date = 2009-06-01 19:22:30 How do i do. select * from table where date NEWER than 1 minute; So it only shows rows with timestamps newer than 1 minute old. Any ideas? Thanks G Quote Link to comment https://forums.phpfreaks.com/topic/160522-solved-php-select-thats-newer-than-1-minute/ Share on other sites More sharing options...
Maq Posted June 1, 2009 Share Posted June 1, 2009 Try something like this: SELECT * FROM table WHERE date > DATE_SUB(NOW(), INTERVAL '1' MINUTE); Quote Link to comment https://forums.phpfreaks.com/topic/160522-solved-php-select-thats-newer-than-1-minute/#findComment-847166 Share on other sites More sharing options...
lynxus Posted June 1, 2009 Author Share Posted June 1, 2009 Awesome! Works perfect. Thanks verymuch!!!! -G Quote Link to comment https://forums.phpfreaks.com/topic/160522-solved-php-select-thats-newer-than-1-minute/#findComment-847169 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.