phpforfun Posted November 8, 2015 Share Posted November 8, 2015 I am making a game with PHP and ajax but I have an issue. When a player joins a queue their user id is inserted into a database field called users. But when users either logout, close the browser, just leave the game in some form of way I need their id to be removed from that field. I know there is jquery .unload function but how reliable is that really? So could anyone help me in finding a reliable way of removing the user id from the field when they leave the game? thanksĀ Quote Link to comment Share on other sites More sharing options...
0x00 Posted November 8, 2015 Share Posted November 8, 2015 A) Use a cron job to periodically crop the list B) As users add the script also deletes, by... C) Use a last update time, if time over limit then ignore (or in above delete) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.