Possible Duplicate:
MySQL get row position in ORDER BY
Calculating rank in PHP/MySQL
I have a game system wrote in php, each user has X amount of money. I have a page that display the most rich users in the site.
$ranking = mysql_query("
SELECT *
FROM users
ORDER BY money DESC
LIMIT 10
");
Now I want give each user his position in the list. I can't select all the information and start to sort just to get one value, it's waste of resources. How can I select the position of a row (where userid = X)?
(MYSQL)