Here is an edited version from long ago to display total player online out of how many slots and how many servers are online.
Database Query File include.php: <?php
ini_set('precision', 5);
$link = mysql_connect('LOCALHOST', 'DATABASE_USER', 'DATABASE PASSWORD');
if (!$link) {
die('Not connected : ' . mysql_error());
}
$db_selected = mysql_select_db('DATABASE_NAME', $link);
if (!$db_selected) {
die ('Can\'t Find DB : ' . mysql_error());
}
//Query Stuff
$active = mysql_query("SELECT SUM(online) FROM tc_game_service_live_stats");
$act = mysql_result($active, 0);
$totalslots = mysql_query("SELECT SUM(slots) FROM tc_game_services");
$tsc = mysql_result($totalslots, 0);
$totalplayers = mysql_query("select sum(players) from tc_game_service_live_stats");
$po = mysql_result($totalplayers, 0);
?>
Don't forget to include the above file where ever your going to display the info. <?php include 'include.php'; ?>
Display Queried Info: <p>Players Online: <?php echo $po; ?>/<?php echo $tsc; ?></p>
<p>Servers Online: <?php echo $act; ?></p>
There is so much more info that can be queried, per server or as a whole.