title: Drop down list with data from database
body: <p>First of all I would like to let you know that I tried every other solution that I found here regarding to my topic.. But nothing worked for me!</p>
  
  <p>As the title says I want to create a drop down list with data from a database! </p>
  
  <p>The connection with the database is right so I don't show you the code! I have tried many ways, one is below.</p>
  
  <p>The only thing that I am getting is a blank list.Thanks!</p>
  
  <pre><code>&lt;select name="Anaktisi"&gt;
    &lt;?php 
  
    $query2="select name from books WHERE sub_ID=1";
    $result2 = mysqli_query($con,$query2);
  
    while ($row2 = mysqli_fetch_array($result2)) { ?&gt;
        &lt;option value="&lt;?php echo $row2['name'];?&gt;"&gt; &lt;/option&gt;
    &lt;?php } ?&gt;
  
  &lt;/select&gt;
  </code></pre>