Basically once a user has logged in im using
to update the users online status (this works)
However when i come to log out i have:
When i come to log out, it does not change my online status to '0' in the db field
Any ideas why this is happening?
I have looked around on google and 90% of most common answers are using the same as what i have
PHP:
$db->query("UPDATE users SET online = '1' WHERE username = '".$db->escape($row['username'])."'");
However when i come to log out i have:
PHP:
include('includes/core.php');
unset($_SESSION['user_id']);
unset($_SESSION['user_login_session']);
unset($_SESSION['user_ip']);
$db->query("UPDATE users SET online = '0' WHERE username = '".$db->escape($row['username'])."'");
header('Location: '.$site.'');
When i come to log out, it does not change my online status to '0' in the db field
Any ideas why this is happening?
I have looked around on google and 90% of most common answers are using the same as what i have