This has me stumped as I honestly thought everything looks right.
// ################## WHOS ONLINE ##########################
// how long you want before a guest is inactive.
// I set it to 300 secs (5mins)
$info[life] = 300;
$info[username] = $_COOKIE[evoboard];
// Do not edit below, unless you know how too
$info[table] = 'whos_online';
$info[ip] = $REMOTE_ADDR;
$info[time] = time();
$info[time_work] = $info[time] - $info[life];
mysql_query("delete * from $info[table] where time < '$info[time_work]'");
$check = mysql_fetch_array(mysql_query("select * from $info[table] where ip = '$info[ip]'"));
if($check)
{
mysql_query("update $info[table] set time = '$info[time]', name = '$info[username]' where ip = '$info[ip]'");
}
else
{
mysql_query("insert into $info[table](ip,time,name) values('$info[ip]','$info[time]','$info[username]')");
}
[u]$info[table] = 'whos_online';
$info[guests_online] = mysql_num_rows(mysql_query("select * from $info[table] and name = ''"));
$info[members_online] = mysql_num_rows(mysql_query("select * from $info[table] and name != ''"));[/u]
echo '<b>Guests Online:</b> ' . $info[guests_online];
echo '<b>Members Online:</b> ' . $info[members_online];
Is giving me this error and won't display the output correctly...
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/nodq/public_html/vbads/index.php on line 141
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/nodq/public_html/vbads/index.php on line 142
Guests Online: Members Online:
Any ideas on what's wrong? In the php code where I have it underlined is where it's getting the error from.