Can anyone tell me why this mysql query and 'selected' isn't working?  It does
keep a fixed id selected but not the one that was selected and aslo doesn't
return any results?

echo "<select name=\"CityID\" size=\"1\" class='menuForm'>";

$result=mysql_query("SELECT City, CityID FROM city ORDER BY City");
while ($row = mysql_fetch_array($result))
    {
        $city_id=$row['CityID'];
                $city=$row['City'];

echo "<option value=\"$city_id\" selected> $city </option>";
}
echo "</select>";

Andrew


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to