I have a online list, I want it to remove the users off list after a certain amount of time they have been inactive.
How would I make the second query work with what im trying to do?
<?php
//On page load with a logged-in user
mysql_query("UPDATE `users` SET `last_activity` = NOW() WHERE `username` = '" . ($_SESSION['username']) . "'");
mysql_query("UPDATE `users`
SET `online` = 0
WHERE `last_activity` < NOW('+11 minutes') ");
?>
Right now it, takes away everyone off the list no matter how much time their timestamp is.