title: How to retrieve row number from specific value in a mysql fetch row/array/assoc result via php?
body: <p>Supposedly I have this sql result in PHP ($myresults = mysql_fetch_… either assoc/row/array):</p>
  
  <pre><code>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  |
  ---------------
  </code></pre>
  
  <p>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).</p>
  
  <p>How to I get that via PHP?</p>
  
  <p>Thanks…</p>
  
  <p>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… </p>