Return a row number from an ordered query list

I have a game records page set up which simply shows the top 5 people in each category.
I also want it show what rank the user is whos looking at that page, so if they were ranked around 300th it would show #300 on the page under the top 5 to show where they are.

Any simple ways of coding this without having to do a query of every user on my website?

obviously they will have to log in so you can use $_SESSION to record the username from the database table and in that table you can have their rank that the user is looking at

so
[php]

<? if(!$_SESSION['username']){ //show rank $sql = mysql_query("SELECT * FROM myMembers WHERE user_name='$username' AND password='$password'"); while($row = mysql_fetch_array($sql)){ echo"Your rank is ".$row['rank']; } } ?>

[/php]

something like that for the rank of the user looking at the web page

Sponsor our Newsletter | Privacy Policy | Terms of Service