Supposedly I have this sql result in PHP ($myresults = mysql_fetch_… either assoc/row/array):
SELECT table1.name as name, sum(table2.numbers) as numbers FROM table2 INNER JOIN
table1 ON table2.fk_id = table1.id GROUP BY name ORDER BY numbers DESC
---------------
| John | 800 |
---------------
| Mark | 500 |
---------------
| Bill | 300 |
---------------
So I am logged as Mark ($_SESSION['name'] == "Mark") and I want to know in which row # the value 'Mark' is located (in this case, row number 1, considering the first row is 0).
How to I get that via PHP?
Thanks…
EDIT: think of it as a High Score or Leaderboards table, I don't need the user id, but the row in which the user is located as of right now…