mysql_result should be used once for a variable. Then the assigned var becomes an ordinary variable and you can use it WITHOUT mysql_result.. So you used
PHP Code:
$numberguest=mysql_result($loggedins,0);
in your code and assign the result to "$numberguest" var which is now an ORDINARY variable. From now on whenever when you want to use $numberguest use it as it is (ie. without mysql_result!)
So replace line echo mysql_result($numberguest,0); to
echo $numberguest;
BTW you else syntax is wrong either: it should be:
PHP Code:
if (mysql_error()) {echo "mySQL error:"; echo mysql_error(); exit;} //show error if any
else
{
echo $totalonline ;
echo $numbervisible ;
echo $numberguest;
}