title: How to copy sql result from one variable to other
body: <p>How to copy sql result from one variable to other <strong>without arrays and foreach</strong> in <code>PHP</code>.</p>
  
  <pre><code>$query="Select * from table";
  $res1=mysql_query($query);
  $res2=$res1; // I need somethink like this, simply, like in other languages
  while($row=mysql_fetch_array($res1)) {
  echo $row['Id'];
  }
  echo '&lt;br&gt;';
  while($row=mysql_fetch_array($res2)) {
  echo $row['Id'];
  }
  </code></pre>
  
  <p>First while will print id, <strong>second not print</strong>.</p>