我有来自这里的国家数据库http://www.webmasterworld.com/html/3018309.htm 有 239 个国家,每个国家都有价值。在选项中选择了另一个国家后,如何使用新值的区域更新区域列表?
$country_query = mysql_query("SELECT * FROM country WHERE status = '1' ORDER BY name ASC");
$zone_query = mysql_query("SELECT * FROM zone WHERE country_id = '" . (int)$country_id . "' AND status = '1'");
<select name="country_id">
<option value=""><?php echo '$text_select;' ?></option>
<?php while ($country=mysql_fetch_array($country_query)) { ?>
<?php if ($country['country_id'] == $country_id) { ?>
<option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
<?php } ?>
<?php } ?>
</select>