Hey, I'm working on an users online script. Right now, at the top of the page, I have:
mysql_query("UPDATE users SET time=NOW() WHERE username = '$user'");
now, my script to retreive online users is:
$getonline = mysql_query("SELECT * FROM users WHERE time <= (NOW()-360)");
while($online = mysql_fetch_array($getonline)) {
echo "$online[username]<br>";
}
now, that's supposed to list the users that were online within the past 6 minutes, but for some reason it sometimes works but other times it lists all the users in the entire database. Anyone have an idea why?