Hi, this is the first time I am posting in such a thread so I hope I am doing it the right way. I am trying to populate a drop down menu through php however it is not returning the correct values. Here is the code:
<td>
<select name="Towns">
<?php
$result = $dataobject->getTowns();
$dsTown = mssql_fetch_array($result);
foreach ($dsTown as $TownId => $TownName)
echo("<option value=" . $TownId . ">" . $TownName . "</option>");
?>
</select>
</td>
function getTowns()
{
$result = new dbconn();
$strsql="exec msp_GetTowns";
$dataset = $result -> connectSql($strsql);
return $dataset;
}
Appreciate any help