Hello Community!
I need some help with a problem im having. When a user logs in, it adds a 1 to a row called "logged_in". Before it lets them in, it checks whats in that row first. If there is a 1, the user is denied because his account is already logged in. If there is a 0, it makes it a 1 then lets them in.
The problem is people are closing their browser and not hitting log out. So the session gets deleted on their computer but the database still thinks he is logged in.
So to fix this, i need something that will like run a MYSQL query automatically and go in and change all the 1s in logged_in to 0s every 2 hours.
Make a SQL statement altering the "logged_in" column when the user logs in. Set the default as 1.
-
"every 2 hours goes through and changes all the 1s to 0s" Set a timer at certain times to alter that field at specific times to go to a 0.
Thanks and Your Help is very much appreciated,
Justin