Drop-down List Problem
Posted: Thu Dec 29, 2011 11:00 am
Hey guys I have a problem with populating my drop-down list. Sorry for such questions but I am new to PHP and I have gone through most of the posts and I still cannot solve it.
This is my code below -
The result is filled with data just to confirm as I echoed everything to a table.
Thanks in advance
TheFreeman.
This is my code below -
Code: Select all
$townDC = new townDC();
$result = $townDC->getTowns();
echo "<select name=town value=''>Town Name</option>";
while($nt = mysql_fetch_array($result)){
echo "<option value=$nt[ID]>$nt[townName]</option>";
}
echo "</select>";
Thanks in advance
TheFreeman.