So I have this PHP function:
function getHurrList() {
$sql = "SELECT HURR
FROM HURRDURR";
return DBIface::connect()->query($sql);
}
and I want to make a custom drop-down box that will display the list of hurrs that are accessed from the database.
<select name="hurr">
<?php
foreach (getHurrList() as $hurrValue){
echo '<option value="';
echo $hurrValue;
echo '">';
echo $hurrValue;
echo "</option>";
}
?>
</select>
When this code is run, what happens is that I get a drop-down list, where each option comes up as 'Array'. How can I fix the foreach loop or replace it with something else so that each HURR in HURRDURR is displayed in the drop-down list on the page?