Menu
Hi,
I want to highlight the appropriate option as selected, when populating a drop down with a query, I’m not sure how refer to the different fields. Can anybody help?
Thankyou
[CODE]
<select name=”ethnicorigin”>
<?php
$link_id = db_connect();
$query = “SELECT * FROM tblethnicorigin;”;
$result = mysql_query($query);
if(!$result) error_message(sql_error());
while ($myrow = mysql_fetch_array($result)) {
echo ” <option value='”. $myrow[ethnicID] .”‘”;
if ($counter == $myrow[ethnicID]){echo ” selected “;}
echo “>” . $myrow[“ethnicOrigin”] . “</option>”;
}
?>
</select>