PHP Code:
<?php
require('forum/admin/config.php');
$db = mysql_connect($servername,$dbusername,$dbpassword) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
unset($servername,$dbusername,$dbpassword,$dbname);
$adminonline = mysql_query("SELECT userid FROM session");
if ($adminonline['userid'] == 1) {
echo("admin is online");
} else {
echo("admin is not online!");
}
?>
I'm trying to see if userid 1 is online on the forum, and if he is, it will say admin is online. However, it just shows admin is not online!
Why is it doing this? Is there something i've missed out here?