title: Change 'while' by 'foreach' in 'mysql_fetch_row' in PHP
body: <p>Is it possible to change <code>while</code> by <code>foreach</code> in <code>mysql_fetch_row</code> in PHP?</p>
  
  <p>For example</p>
  
  <pre><code>$result = mysql_query("SELECT * FROM test");
  
  while ($row = mysql_fetch_row($result)) {
      print_r($row);
  }
  </code></pre>
  
  <p>This will take all records(rows) from query <code>SELECT * FROM test</code>.</p>
  
  <p>But, if foreach is used </p>
  
  <pre><code>foreach (mysql_fetch_row($result) as $row) {
      print_r($row);
  }
  </code></pre>
  
  <p>This will take only first record(row) from query <code>SELECT * FROM test</code>.</p>
  
  <p>Is it possible get all records by <code>foreach</code> loop  when using with <code>mysql_fetch_row</code> ?</p>