Hi All:
I am building a simple dynamic drop down. It is working but not correctly. The field that should should be appearing as the option is not appearing. A number is appearing instead. Checking the source code shows the filed that should be appearing as falling outside the <option>. Maybe I have been looking at this too long!
<?php
require($_SERVER['DOCUMENT_ROOT'] . '/inc/dbconn.php');
if ($result = mysqli_query($link, "SELECT Sport FROM Sports ORDER BY Sport")) {
echo "<select name='SportCode' size='1'>";
echo "<option></option>";
while ($row = mysqli_fetch_array($result)){
echo "<option>" . printf($row['Sport']) . "</option>";
}
echo "</select>";
mysqli_free_result($result);
}
mysqli_close($link);
?>
And here is the a snippet of source code
<select name='SportCode' size='1'>
<option></option>
Actor<option>5</option>
Announcer<option>9</option>
</select>