Is there any way I can get the actual row number from a query?
I want to be able to order a table called league_girl by a field called score; and return the username
If you just want to know the position of one specific user after order by field score, you can simply select all row from your table where field score is higher than the current user score. And use row number returned + 1 to know which position of this current user.
Assuming that your table is league_girl
and your primary field is id
, you can use this:
SELECT count(id) + 1 as rank from league_girl where score >