PHP - Unix timestamp [closed]
I have this:
$time = time();
SELECT * FROM users WHERE lastlogin>'$time-86000'
How do I select from the database, where the lastlogin has been completed within the last 24 hours?
I also have this:
SELECT * FROM users WHERE signupdate>'$time-86000'
What I wish to archive here is, how do I select from the database, where the last signupdate is within 24 hours
Mysql can handle unix timestamps as well
select * from table where stamp > unix_timestamp() - 24*3600
SELECT DATEDIFF(signupdate,.'date('h-i-s).') FROM users;
Then if it is above 1 its more than 24hours, else its not.
Ill try to see if i can get into a where clause...
精彩评论