I have a mysql database that stores users that are online. Is there an efficient way of triggering an event after a time period to detect the users that are inactive (to set their status to “offline”)? I’m storing the last time the user was active in a table (TIMESTAMP value).
Thanks!
To run a php script regularly, you have many solutions :
set_time_limit()andignore_user_abort(). Then you create a script that loops continuously and checks for the moment whether there is something to do.