Welcome Guest, Not a member yet? Register   Sign In
last_activity in session class is int(10) - how to query new session
#1

[eluser]mradlmaier[/eluser]
Hi,

If I use the database to store ci sessions, the last_activity column is of INT(10).

How do i select-query all rows with a session younger then let´s say 20 minutes?

Thanks,
Michael
#2

[eluser]Dam1an[/eluser]
Well, you can get the current time using time() and then subtract the amount you want (in this case 20 minutes x 60 seconds = 1200) and use that for the where clause
#3

[eluser]jegbagus[/eluser]
in mysql :
Code:
SELECT * FROM `sessions` WHERE UNIX_TIMESTAMP( ) - last_activity > 60 * 20




Theme © iAndrew 2016 - Forum software by © MyBB