Okay, I pretty much have it sussed out. But I'm stuck where to reset their '$time' to 00:00:00 after they become inactive from the website. As currently, if they log in.. They become active, and remain so no matter what.
Here's my code :
$user = $_SESSION['username'];
$time = time();
mysql_query("UPDATE `users` SET `online` = $time WHERE `user_id` = $user_id");
$time = $time - 100;
$online_user = mysql_query("SELECT * FROM `users` WHERE `online` >= '$time'");
while($users_row = mysql_fetch_array($online_user)){
$user = $users_row['username'];
$online .= "$user, ";
}
That checks the user is online etc and creates the format for them to be displayed
echo '<font size="2">Who\'s Online : </font>';
echo '<br><font size="1" color="green">';
echo $online;
echo '</font>'
And that is on the footer.