-
-
Save gsmcwhirter/472828 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$query = "SELECT mapid, kills, games, kills/games as kpg, connections, connections/games as cpg FROM ps_c_map_data ORDER BY kpg IS NOT NULL DESC, kpg DESC, games desc"; | |
$result = mysql_query($query) | |
or die('Sorry, we could not retrieve pending from the database. Please try again.'); | |
$totalmaps = mysql_num_rows($result); | |
while ($row=mysql_fetch_array($result, MYSQL_ASSOC)) | |
{ | |
$mapid = $row['mapid']; | |
$kills = (int)$row['kills']; | |
$games = (int)$row['games']; | |
$connections = (int)$row['connections']; | |
//$kills_per_game = $kills / $games; | |
//$kills_per_game = round($kills_per_game,2); | |
//$conn_per_game = $connections / $games; | |
//$conn_per_game = round($conn_per_game,2); | |
$kills_per_game = round($row['kpg'] ? $row['kpg'] : 0, 2); | |
$conn_per_game = round($row['cpg'] ? $row['cpg'] : 0, 2); | |
if ($games >= 100) | |
{ | |
$query2 = "SELECT uniqueid FROM ps_map WHERE mapid='$mapid'"; | |
$result2 = mysql_query($query2) | |
or die('Sorry, we could not retrieve pending from the database. Please try again.'); | |
$row2=mysql_fetch_array($result2, MYSQL_ASSOC); | |
$map = $row2['uniqueid']; | |
echo "<tr>\n"; | |
echo "<td>$map</td>\n"; | |
echo "<td>$games</td>\n"; | |
echo "<td>$kills_per_game</td>\n"; | |
echo "<td>$conn_per_game</td>\n"; | |
echo "</tr>\n"; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment