title: MySQL select first 5 rows after query
body: <p>I have a mysql result (having many rows) that I will use later. For now, I only need to access (sum) the first 5 rows. The problem is that the rows were saved from the query using "AS", so now they can be accessed by using <code>$row['name']</code> . How can I select the first 5 rows without using the "name" for each of them?  </p>
  
  <p>Is there any way for doing like so:</p>
  
  <p>PHP:</p>
  
  <pre><code>for($i=0;$i&lt;5;++$i)
     echo $row[$i];
  </code></pre>
  
  <p>?</p>
  
  <p><strong>EDIT</strong><br>
  Sorry, my question was wrong.
  Actually: How can I use the same $result 2 times without loosing the values by fetching the array?</p>