title: Print all table data from mysql into a html table
body: <p>I've been trying to print all users into a html table. The objective is that the site administrator can edit the information.
  I've done the following code so far, but I can't understand how I will print User1_Name, User1_Email and password into a table row. I want this for every user on the database.</p>
  
  <pre><code>&lt;body&gt;
      &lt;div class="edituser"&gt; 
        &lt;h1&gt; Edit Users &lt;/h1&gt;
  
        &lt;table&gt;
            &lt;tr&gt;
                &lt;th&gt;User Name&lt;/th&gt;
                &lt;th&gt;Email&lt;/th&gt;
                &lt;th&gt;Password&lt;/th&gt;
  
            &lt;/tr&gt;
     &lt;?php include("include/headerhomeadmin.php");?&gt;
  
  
          &lt;?php while($row = mysqli_fetch_assoc($result)) {
          /*$line[]=$row;*/  
  
          echo 
  
          $userusername =$row['username'];
          $useremail =$row['email'];
          $userpassword=$row['password'];
  
          ?&gt;
        &lt;td&gt;&lt;?php echo implode(" ", $line)?&gt;&lt;/td&gt; 
  
          &lt;?php } ?&gt;
  
          &lt;/table&gt;       
  
      &lt;/div&gt;  
  </code></pre>
  
  <p>Can someone help me? </p>
  
  <p>UPDATE:
  My code is now printing the first username, the email from the second user and the password from de third user.
  The code is the following:</p>
  
  <pre><code>&lt;body&gt;
  &lt;div class="edituser"&gt; 
    &lt;h1&gt; Editar Utilizadores &lt;/h1&gt;
  
    &lt;table&gt;
        &lt;tr&gt;
            &lt;th&gt;Nome de Utilizador&lt;/th&gt;
            &lt;th&gt;Email&lt;/th&gt;
            &lt;th&gt;Password&lt;/th&gt;
  
        &lt;/tr&gt;
  
        &lt;tr&gt;     
  </code></pre>
  
     
  
  <pre><code>    &lt;?php while($row =  mysqli_fetch_assoc($result)) { 
  
              $userusername =$row['username'];
      ?&gt;
  
            &lt;td&gt; &lt;?php echo $userusername ?&gt;  &lt;/td&gt;
  
        &lt;?php while($row =  mysqli_fetch_assoc($result)) { 
  
              $useremail =$row['email'];
  
      ?&gt;
  
            &lt;td&gt; &lt;?php echo $useremail ?&gt;  &lt;/td&gt;
  
        &lt;?php while($row =  mysqli_fetch_assoc($result)) { 
  
              $userpassword=$row['password'];
  
      ?&gt;
            &lt;td&gt; &lt;?php echo $userpassword ?&gt;  &lt;/td&gt;
  
  
      &lt;?php }
      }
  </code></pre>
  
  <p>}?></p>
  
  <p>How can I fix this?</p>