I am using a MySQL database to record player highscores on a game I am creating. The MySQL database is being accessed through a PHP file "highscores.php".
The highscores are all recorded inside the database, but I want the actual rank numbers to be implemented by the PHP file. I want to be able to query for the ranking of a specific player, instead of only querying for his/her highscore.
I am using this to get the highscore of my player:
$username = $_GET["username"];
$checkID = mysql_query("SELECT * from Highscores WHERE Username =
'$username' ORDER BY Score DESC");
$row = mysql_fetch_array($checkID);
echo $row["Score"];
Now to get the ranking of my player amongst all the other players, all I need to do is find the index of the row in question... But how do I do that?
Thanks in advance!