Hey, I'm having a bit of trouble displaying the Rank # next to the player, here's the code I have so far:
echo "<b>Rankings</b> - <a href=game.php?view=rankings&start=0&end=25>Ranks 1-25</a> | <a href=game.php?view=rankings&start=26&end=50>Ranks 26-50</a> | <a href=game.php?view=rankings&start=51&end=75>Ranks 51-75</a> | <a href=game.php?view=rankings&start=76&end=100>Ranks 76-100</a><Br>";
echo "<br>";
$upscores = mysql_query("SELECT * FROM players WHERE 1");
while($scoreinfo = mysql_fetch_array($upscores)) {
$score = round(($scoreinfo[texp]*5)+($scoreinfo[money]/10)+($scoreinfo[kills]*50)-($scoreinfo[deaths]*10));
mysql_query("UPDATE players SET score='$score' WHERE username = '$scoreinfo[username]'");
}
$getusers = mysql_query("SELECT * FROM players WHERE 1 ORDER BY score DESC LIMIT $start,$end");
echo "<table cellspacing=3 cellpadding=3 border=0>";
echo "<tr><td><b>Rank</td><td><b>Score</td><td><b>Player</td><td><b>Kills</td><td><b>Deaths</td><td><b>Experience</td><td><B>Squad</td></tr>";
while($ruserinfo = mysql_fetch_array($getusers)) {
$rusquad = mysql_fetch_array(mysql_query("SELECT * FROM squads WHERE num = '$ruserinfo[squad]'"));
echo "<tr><td>$rank</td><td>$ruserinfo[score]</td><td>$ruserinfo[username]</td><td>$ruserinfo[kills]</td><td>$ruserinfo[deaths]</td><td>$ruserinfo[texp]</td><td>$rusquad[name]</td></tr>";
}
echo "</table>";
the variable $rank is supposed to display the rank number, but I can't figure out a good way to do it, I tried using the for($rank=$start;$rank<($end+1);$rank++) {
} but it didn't work.