title: PHP Get row 'id' from MySQL query results
body: <p>I read somewhere (sorry I forgot where), that there is a way to associate an index number to rows fetched from an MySQL query result using a native PHP function (the person was not sure about the syntax so he didn't wrote it). For example:</p>
  
  <p>The usual way:</p>
  
  <pre>
  $count = 1;
  while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
      echo "&lt;li&gt; ". $count ."id: " . $row['id'] . " lon: " . $row['lon']. ", lat: ". $row['lat'].", ". $row['road']. " &lt;/li&gt;";
      $count++;
  }
  </pre>
  
  <p>I know that thinking of this other way is not that important, but I'm just curious if there really is a function for that purpose.</p>