title: how can i output all the rows from my database?
body: <p>I want to output all of the rows from my sql database into a table but I can only get 1 row to output. 
  this is my code so far:</p>
  
  <pre><code>&lt;?php
  
  $users = mysqli_query($database, "SELECT * FROM people");
  if (mysqli_num_rows($users) == 0) {
  
  echo ('No matches in the database');
  
  }
  
  while ($row = mysqli_fetch_array($users)){
      $name = $row['name'];
      $postcode = $row['postcode'];
      $email = $row ['email'];
  }
  ?&gt;
  
  &lt;table&gt;
  &lt;tr&gt;&lt;td&gt;Name:&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;?php echo ($name) ?&gt;&lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;&lt;td&gt;postcode:&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;?php echo ($postcode) ?&gt;&lt;/td&gt;&lt;/tr&gt;
  
  &lt;tr&gt;&lt;td&gt;email:&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;?php echo ($email) ?&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>This only outputs one, how can I output all the rows?</p>