How to populate html combo box with mysql data
- by user225269
Please help, I'm having trouble loading mysql data on the combo box.
The data that I'm loading is 1 column from a table.
Here is my current code, and it crashed firefox for some reason:
<td colspan=”2?>Religion</TD>
<td>
<select name="REL" onClick="submitCboSemester();">
<?php
$query_disp="SELECT * FROM Religion ORDER BY RID";
$result_disp = mysql_query($query_disp, $conn);
while($query_data = mysql_fetch_array($result_disp))
{
?>
<option value="<? echo $query_data["RID"]; ?>"<?php if ($query_data["RID"]==$_POST['REL']) {?>selected<? } ?>><? echo $query_data["RELIGION"]; ?></option>
<? } ?>
</select>
</td>
The column is RELIGION and it ID is RID
How do I populate the combo box with all the data in the column RELIGION