title: How do I loop through a mysql query with php
body: <p>I tried to use this function</p>
  
  <pre><code>        $conn = db_connect();
          while ($newsfeed = $conn-&gt;query("select info, username, time from newsfeed ORDER BY time DESC LIMIT 10"))
          {
                      (...)
                       echo "&lt;p&gt;User $newsfeed_username just registerted ".$minutes." min ago &lt;/p&gt;&lt;br&gt;";
  </code></pre>
  
  <p>but it only shows the latest row over and over again. I want to loop through all the queries from </p>
  
  <pre><code>select info, username, time from newsfeed ORDER BY time DESC LIMIT 10
  </code></pre>
  
  <p>in descending order. </p>