Ive made a simple script to check to see if a member is online or not.
It check's my _active table in mysql to see if the user's name is in their ( the user get's placed in the table when they login and get's removed when they log out )
It's not returning the correct status tho.
// Online or Not? ;]
$lookupuser == $rate_array["user_name"];
$lookup = "select name from shocc_active where name = '$lookupuser'";
$query = mysql_query($lookup) or die(mysql_error());
if(mysql_num_rows($query)) {
$user_status = "Online";
} else {
$user_status = "Offline";
}
This will select the user's profile name ( rate_array[username]) from the active table to see if they are online or not. If mysql returns a row , online , if not , offline.
Any other idea's on how i could write this to work better?