Avatar
11-15-04, 04:30 PM
Hi there!
I have a code that returns results from sql database table (part of my forum database) my forum member count. So I have a forum members count on my main page. The thing is that the forum users database has a +1 additional anonymous user that must not be deleted (it counts for all the anonymous users logging in and wanting to register). The problem is that that php code retuns the member count and that additional anonymous user in the database, so I always see +1 additional user than I really have.
the code is this (not by my hand written, I don't know php)
if($forumname == 'phpBB2')
{
if($settings[0]) // Display member count?
{
$countusers = $DB->query_first("SELECT COUNT(*) AS users FROM " . $tableprefix . "users");
echo 'Foruma dalibnieki: ' . $countusers['users'] . '<br />';
}
how do I set that this code returns the countusers minus one value?
thanx in advance!!
I have a code that returns results from sql database table (part of my forum database) my forum member count. So I have a forum members count on my main page. The thing is that the forum users database has a +1 additional anonymous user that must not be deleted (it counts for all the anonymous users logging in and wanting to register). The problem is that that php code retuns the member count and that additional anonymous user in the database, so I always see +1 additional user than I really have.
the code is this (not by my hand written, I don't know php)
if($forumname == 'phpBB2')
{
if($settings[0]) // Display member count?
{
$countusers = $DB->query_first("SELECT COUNT(*) AS users FROM " . $tableprefix . "users");
echo 'Foruma dalibnieki: ' . $countusers['users'] . '<br />';
}
how do I set that this code returns the countusers minus one value?
thanx in advance!!