Forum Moderators: coopster
function pspg(){
$score=mysql_query("SELECT *, COUNT(Player) AS gp, SUM(Score) AS score, (score/gp) AS spg FROM Scorecard WHERE score > 0 GROUP BY Player ORDER BY spg DESC Limit 0,10");
echo "<table>";
echo "<tr>
<th class='th'>Rank</th>
<th class='th'>Pilot</th>
<th class='th'>Clan</th>
<th class='th'>GP</th>
<th class='th'>SPG</th></tr>";
while($ps=mysql_fetch_array($score)){
echo "<tr>";
echo "<td class='tdp'>" . ++$i . "</td>";
echo "<td class='tdp'>" . '<a href=o.php?p=' . $ps['Player'] . '>' . $ps['Player'] . '</a>' . "</td>";
echo "<td class='tdp'>" . '<a href=o.php?c=' . $ps['Clan'] . '>' . $ps['Clan'] . '</a>' . "</td>";
echo "<td class='tdp'>" . $ps['gp'] . "</td>";
echo "<td class='tdp'>" . round($ps['spg'], 2) . "</td>";
echo "</tr>";
}
echo "</table>";
echo "<br>";
}