
$table = $modx->getFullTableName('web_users');
$countQuery = "SELECT COUNT(id) AS c FROM $table WHERE 1 LIMIT 0,1";
$result = mysql_query($countQuery) or die( mysql_error() );
if(mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_array($result)) {
extract($row);
echo "There are currently $c web-users.";
}
}