<?php include "../../mainfile.php"; $county=$_POST['county']; $sql = "select city from `" . $xoopsDB->prefix("phone_book") . "` where county='{$county}' group by city order by zip"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); while (list($city) = $xoopsDB->fetchRow($result)) { echo "<option vlaue='{$city}'>{$city}</option>"; }