I am trying to to let users choose the state filed from a drop down in the form, but although the query works, the DB is connected, the drop down does not display the list.
Not sure if relevant but i'm running Windows Server, IIS 10 and the latest PHP and MySql.
<div class="form-group col-md-3">
<label for="state">State</label>
<select class="form-control" name="state" id="state">
<?php
// Query to find STATE
$sql1 = "SELECT * FROM codetable WHERE category = 'state'";
$result1 = $conn->query($sql1);
$row1 = mysqli_fetch_array($result1);
while($row1 = mysqli_fetch_array($result1))
{
echo '<option value=" '.$row1['code'].' "> '.$row1['description'].' </option>';
}
?>
</select>
</div>
I expect the list from the DB to be in the dropdown, but it is empty (No dropdown list).