Code:
<?
require("forum/admin/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
$loggedins=mysql_query("SELECT COUNT(userid) AS users FROM session",$db) or die ("oops");
while($loggedin = mysql_fetch_array($loggedins))
$totalonline=number_format($loggedin[users]);
$users=mysql_query("SELECT COUNT(userid) AS registeredusers FROM user",$db) or die ("double oops");
while($user = mysql_fetch_array($users))
$totalusers=number_format($user[registeredusers]);
echo "<font face=arial size=2>
We have a total of $totalusers registered users. There are currently $totalonline users online at the moment.</font>
";
?>
should do it...
[edited to correct invalid query]