As I stated on the title, I want to fetch data from the database and make them a value for option in HTML. But it shows nothing. In my database, I have 20 data, the option has 20 values tho, but it's all blank. Can you show me where I get it wrong?
<?php
$query = "SELECT name_program FROM vote.program";
$result = mysql_query($query);
?>
<div class="form-group">
<label>Program</label>
<select class="form-control">
<option selected disabled>-- Select Program --</option>
<?php
while ($row = mysql_fetch_array($result)){
echo '<option value='.$row['name_program'].'</option>';
}
?>
</select>
</div>