Possible Duplicate:
MySQL get row position in ORDER BY
I have a table of users and I want to order them by a column named crown. I then wanted to find out where they are in the list but not totally sure on how to do it. I have tried to Google it but not totally sure on what to type in. (Crown has INT input.)
So I have the first line:
mysql_query("SELECT * FROM users ORDER by crown DESC");
How would I then find out where a user is in the list while ordered by crown?
Thanks in advance.
I’d do something like this, assuming you can get the user’s crown value.
Or if you can’t get their crown value: