PHP: showing every if every user´s online or not
<p>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:</p>

<pre><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 &gt; $timeoutOffline) {
        echo "";
    }
    else if ($thetime - $last_access &gt; $timeoutIdle) {
        echo "&lt;span class='statusIdle'&gt;Idle&lt;/span&gt;";
    } else {
        echo "&lt;span class='statusOnline'&gt;Online&lt;/span&gt;";
    }
}
</code></pre>

<p>How do I make an query, where it displays if youre online?</p>
