title: How to populate HTML dropdown list with values from database
body: <p>as part of a HTML form I am creating I would like to have a dropdown list which will list all the usernames in my database.</p>
  
  <p>I thought the following code would do the trick but the dropdown list is empty - could someone assist me in what i'm doing wrong? Thanks.</p>
  
  <pre><code>&lt;tr&gt;
  &lt;td&gt;Owner&lt;/td&gt;
  &lt;td&gt;
  &lt;select name="owner"&gt;
  &lt;?php 
  
  $sql = mysqli_query($connection, "SELECT username FROM users");
  
  while ($row = $sql-&gt;fetch_assoc()){
  
  ?&gt;
  &lt;option value="owner1"&gt;&lt;?php echo $row['username']; ?&gt;&lt;/option&gt;
  
  &lt;?php
  // close while loop 
  }
  ?&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>