Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User's Rank Query..! 1

Status
Not open for further replies.

triquad

Programmer
Feb 5, 2009
16
0
0
EG
I have made a flash game that has a ranking system which allows the players to know the top 10 users ranked by score. That works fine but I'm trying to figure out a query that allows the player to know his own ranking if he's not listed in the top 10 players.

The query I use for ranking the top 10 is:

Code:
mysql_query ( "SELECT * FROM 'myscore' ORDER BY score DESC")

Any ideas ?!
 
all you have to do to get a player's ranking is to count the number of players with a higher score than his, and add 1

by the way, that couldn't be your actual query, because you can't write a SELECT statement to pull rows from a string
Code:
SELECT * FROM [red]'myscore'[/red] ORDER BY score DESC
:)

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top