title: cannot reset query row after executing while loop
body: <p>Hi whenever I try to reset row so that I can use same rows for a new column I get error: reset() expects parameter 1 to be array</p>
  
  <p>I am new to PHP and was trying to build a table that outputs data stored in MySQL:</p>
  
  <pre><code>&lt;?php
  
  include ('config.php');
  
  $user = mysqli_query($userDB, "SELECT username, email FROM user") or die(mysqli_error());
  
  ?&gt;
   &lt;table width="200" border="1"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;th scope="col"&gt;Username&lt;/th&gt;
        &lt;th scope="col"&gt;Email&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td align = "center"&gt;
      &lt;?php while($row = mysqli_fetch_assoc($user)) echo $row["username"]."&lt;br&gt;"; reset($row); ?&gt;
      &lt;/td&gt;
      &lt;td align = "center"&gt;
      &lt;?php while($row = mysqli_fetch_assoc($user)) echo $row["email"]."&lt;br&gt;" ?&gt;
      &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Any better way I can do this?</p>