Sorry I shuold be more specific, it does not update the database, it just does nothing.
What i want is for the following query to be executed if the user closes the browser:
mysql_query("UPDATE users SET status='Offline' where alias='".($_SESSION['alias'])."';");
The user status is online even if the browser is closed and reopened, it does not execute the query. What i want is to update the database on browser close.
PLEASE HELP - Update database on browser close??
Moderator: General Moderators
Re: PLEASE HELP - Update database on browser close??
A better way (and very common way) to determine users online is to use the time they were last active. Update a timestamp when a user performs an action.
If a user hasn't performed an action with the last X (say 5) minutes, then they are considered to be offline.
That is how this board does it.
If a user hasn't performed an action with the last X (say 5) minutes, then they are considered to be offline.
That is how this board does it.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.