OnyxChase
12-16-2008, 05:21 AM
Hello,
I had a code that has worked for ages but for some reason today I noticed it was showing a completely OFF number, '13263'.
Basically I have an OFF-vBulletin script that needs this information. It is called using the following:
$timenow = time();
$datecut = $timenow - 86400;
mysql_connect('localhost', 'username', 'password');
mysql_select_db('database');
$result = mysql_query("SELECT COUNT(*) FROM vbulletin_session WHERE lastactivity > $datecut");
$result = mysql_fetch_array($result);
$onlineusercount = $result[0];
echo $onlineusercount . ' Users Online Today';
Anybody can figure out what I am doing wrong? It should be something in the 400 or 500 users online today, not 13000!
I had a code that has worked for ages but for some reason today I noticed it was showing a completely OFF number, '13263'.
Basically I have an OFF-vBulletin script that needs this information. It is called using the following:
$timenow = time();
$datecut = $timenow - 86400;
mysql_connect('localhost', 'username', 'password');
mysql_select_db('database');
$result = mysql_query("SELECT COUNT(*) FROM vbulletin_session WHERE lastactivity > $datecut");
$result = mysql_fetch_array($result);
$onlineusercount = $result[0];
echo $onlineusercount . ' Users Online Today';
Anybody can figure out what I am doing wrong? It should be something in the 400 or 500 users online today, not 13000!