The-Last-Escape Posted May 1, 2007 Share Posted May 1, 2007 I basically just need to be able to display all logged in users. The actual log in authentication I'm able to cope with and I can also get logged in users into a dbase table so as to display them. However I'm stuck on how to delete them from the table in the event of them logging off the site. I found tutorials but as always seems to be the case they're never exactly what you need. In short how can I clean up a mySQL table if the user logs off and the session ends. thanks Link to comment https://forums.phpfreaks.com/topic/49552-solved-users-online/ Share on other sites More sharing options...
trq Posted May 1, 2007 Share Posted May 1, 2007 You need to store a timestamp along with the users details in the database. You then need to update this timestamp on all page requests, while your at it run a DELETE query to delete any user who's timestamp is older then say 10 mins. You could also run a cron job every 10 minutes to perform the DELETE query. Link to comment https://forums.phpfreaks.com/topic/49552-solved-users-online/#findComment-242911 Share on other sites More sharing options...
The-Last-Escape Posted May 1, 2007 Author Share Posted May 1, 2007 Thank you Link to comment https://forums.phpfreaks.com/topic/49552-solved-users-online/#findComment-242914 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.