$SQL = "SELECT * FROM cities WHERE state='".$_POST['state'].'"';
$result = mysql_query($SQL) OR die("Query error: ".mysql_error());
# Print the opening for the <select> element
echo '<select name="city">';
# loop through result set
while ($row = mysql_fetch_assoc($result)){
# produce HTML output here
echo '<option>'.$row['city'].'</option>'."\n";
}
echo '</select>';