How can I use strtotime to return the time 30 mins ago, for example:
date("ymd H:i:s",strtotime("-30 minutes"));
ahmedtheking
9:36 pm on Apr 12, 2007 (gmt 0)
Sorry ignore that, it's all good.
ericjust
9:39 pm on Apr 12, 2007 (gmt 0)
Your example works.
ahmedtheking
9:52 pm on Apr 12, 2007 (gmt 0)
Yep it does! Ok, so now, I'm looking at the best way I can compare data within my MySQL database to see what times are longer than 30 mins ago. Now is the best way to do the checking via php or mysql? And what would be the code? If any?
coopster
1:59 am on Apr 14, 2007 (gmt 0)
I would use the database engine:
SELECT CURRENT_TIMESTAMP - INTERVAL 30 MINUTE;
ahmedtheking
12:52 pm on Apr 14, 2007 (gmt 0)
How would I script that? SELECT * FROM table WHERE userstimestamp <= CURRENT_TIMESTAMP?
ahmedtheking
12:56 pm on Apr 14, 2007 (gmt 0)
Ok this worked: select * from LoggedIn where lastupdate <= (CURRENT_TIMESTAMP - INTERVAL 21 MINUTE);