can anyone help me with a query that will get number of users online?
i tried this :
PHP Code:
// Returns the total amount of people online RIGHT NOW!
function getTotalUsersOnline() {
$query = "SELECT userid FROM `session` WHERE userid != 0";
$result = mysql_db_query("sampleci_samplecitynet", $query);
if ($result) {
$numOfRows = mysql_num_rows ($result);
}
return $numOfRows;
} // end getTotalUsersOnline()
but it doesn't give me the correct number of users online.
can someone assist me?
thanks in advance!
..jordan