Hey, what is delete all the users who have been not be active within the last five minutes, or the current user
PHP Code:
$query = "DELETE FROM _ONLINE_USERS WHERE session_id = '". session_id() . "' OR DATE_SUB(now(), interval 5 minute) >= time";
Then i insert the current users information in to my _ONLINE_USERS table using
PHP Code:
$query = "INSERT INTO
{$this->dbc->prefix}_ONLINE_USERS
(username,ip_address,session_id,time,page,user_agent)
VALUES
(
'$uname',
'{$_SERVER['REMOTE_ADDR']}',
'" . session_id(). "',
NOW(),
'{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}',
'{$_SERVER['HTTP_USER_AGENT']}'
)";