I want to populate a dropdownlist from a database using PHP.My table name is msg_people_contact and column to be inserted into is primary_email.I have a code and it connects to the database but the data is not shown in the dropdownlist.Can anyone help me with this code?
<td><label>
<select>
<?php
$sql="SELECT primary_email FROM msg_people_contact";
$result =mysql_query($sql);
while ($data=mysql_fetch_array($result)){
?>
<option value ="<?php echo $data['primary_email'] ?>"</option>
<?php } ?>
</select>
</label></td>
</tr>