Sunday, 18 August 2013

How to get ranking of specific player?

How to get ranking of specific player?

I have a list of players. The players are sorted by points. What I'd like
to know is how do I get the ranking number of a CERTAIN player?
This is my code so far (which doesn't work because it has bugs):
$rank = mysql_query (SET @rank := 0;
SELECT *, @rank := @rank + 1
FROM ava_users
WHERE user = '".$id."'
ORDER BY points DESC);
Any help, please?

No comments:

Post a Comment