PHP: showing every if every user´s online or not

heke911

New Member
How can i filter out online users, if I have an column "lastaccess" that have an unix time() stamp. Then i usually have this function:\[code\]function showStatus($userid) { $timeoutIdle = 80; $timeoutOffline = 150; $row = mysql_query("select last_access from users where id='$userid'"); $read = mysql_fetch_array($row); $last_access = $read["last_access"]; $thetime = time(); if ($thetime - $last_access > $timeoutOffline) { echo ""; } else if ($thetime - $last_access > $timeoutIdle) { echo "<span class='statusIdle'>Idle</span>"; } else { echo "<span class='statusOnline'>Online</span>"; }}\[/code\]How do I make an query, where it displays if youre online?
 
Back
Top