Home
Forums
Members
Search
Help
New topics
Todays topics
Website
Welcome Guest, Not a member yet?
Register
Sign In
Login
Username:
Password:
Remember me
Lost Password?
CodeIgniter Forums
Archived Discussions
Archived Development & Programming
last_activity in session class is int(10) - how to query new session
Share on Google
Share on Facebook
Share on Twitter
View a Printable Version
Subscribe to this thread
Add Poll to this thread
Send thread to a friend
Linear Mode
Threaded Mode
last_activity in session class is int(10) - how to query new session
El Forum
Guest
#1
09-14-2009, 06:48 AM
[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
El Forum
Guest
#2
09-14-2009, 06:53 AM
[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
El Forum
Guest
#3
09-14-2009, 07:17 AM
[eluser]jegbagus[/eluser]
in mysql :
Code:
SELECT * FROM `sessions` WHERE UNIX_TIMESTAMP( ) - last_activity > 60 * 20
--------------------
Private Messages
User Control Panel
Who's Online
Search
Forum Home
General
-- News & Discussion
-- Events
-- Lounge
-- Regional User Groups
Using CodeIgniter
-- Installation & Setup
-- Model-View-Controller
-- Libraries & Helpers
-- Best Practices
-- Choosing CodeIgniter
-- General Help
CodeIgniter 4
-- CodeIgniter 4 Roadmap
-- CodeIgniter 4 Development
-- CodeIgniter 4 Feature Requests
-- CodeIgniter 4 Support
-- CodeIgniter 4 Discussion
-- CodeIgniter 4 Addins
Development
-- CodeIgniter 3.x
-- CodeIgniter 2.x
-- Issues
-- NetBeans Plugin
External Resources
-- Spotlight
-- Learn More
-- Jobs
-- Addins
Archived Discussions
-- Archived Libraries & Helpers
-- Archived Development & Programming
Theme © iAndrew 2016 -
Forum software by © MyBB