I am trying to populate an html select list using an array of customer names, I am using the following code but it does not seem to work. I have a function that query's a mssql db and gets the names. I know that works fine as I am using it in other code, for some reason when i try to populate the select list it is coming up blank. Would it be better or more efficient to use a for loop? What is the best way to accomplish this? Thank you
<select name="customers">
<?php
$custNames = getCustomers();
foreach($custNames as $customers){
echo '<option value="' . $customers . '">' . $customers . '</option>';
}
?>
</select>