I just got an empty pull down with your code. I moved it around a bit to this...
$sql = "SELECT DISTINCT location FROM ".$xoopsDB->prefix("users")." ORDER BY location";
$result = $xoopsDB->query($sql);
echo "<SELECT name='location_text'>";
while ($location = $xoopsDB->fetchArray($result)) {
echo "<OPTION value='".$location."'>".$location."</OPTION>";
}
echo "</SELECT>";
Which gives me a pull down with "Array" as the key and the value for five select options rather than the country names. There are five countries in the DB but only 4 unique, so I'm not sure what's going on there.
The other problem is that I can't just stick this on the page with the code. Maybe I'd need to make a function or something.
Thanks,
Andrew