$conn = mysql_connect("localhost","root"," $conn = mysql_connect("localhost","root"," /連接資料庫 mysql_query("set names utf8"); mysql_select_db("bbs"); $rs = mysql_query("select id,cname,parentid from areas where parents=' = mysql_fetch_array($rs)) { ?>
} ?>
show.php
header("content-type:/html; -8");
$province_id = $_GET['id']; if($province_id=='10000000' || $province_id=='11000000' || $province_id=='180000000000000 =='31000000') { //直轄市 $sql = "select id,cname from areas where id='{$province_id}'"; id,cname from areas where parentid={$province_id}"; }