全国省市区三级数据库(单表)

 全国省市区三级数据库(单表)

 

 

switch($action){	
	   
	case 'manage':	        
    $parentid = $parentid ? $parentid:1;
    $query = "select * from ".TABLE_REGION." where parent_id='$parentid' order by region_id asc";
    $result = $db->query( $query );  

    include( admintpl( "region_manage" ) );
    break;
    
  case "enable" : 
    for($i=0;$i<count($uid_hidden);$i++) {    
      if($uid_hidden[$i]) {  
      	 $en = "en_$i";
      	 $passed = $$en; 
      	 $passed = $passed ? $passed:0; 
         $db->query("UPDATE ".TABLE_REGION." SET passed='$passed' WHERE region_id='$uid_hidden[$i]'");
      }
    }
    move_page( $PHP_REFERER );
    break;        
}

 

 

省市区三级数据库表 CREATE TABLE hat_city ( id int NOT NULL , cityID varchar(6) default NULL, city varchar(50) default NULL, father varchar(6) default NULL, PRIMARY KEY (id) ) CREATE TABLE hat_province( ....) CREATE TABLE hat_zone ( ....) INSERT INTO hat_province VALUES (3,'130000','河北省'); INSERT INTO hat_province VALUES (4,'140000','山西省'); INSERT INTO hat_province VALUES (5,'0000','内蒙古自治区'); INSERT INTO hat_province VALUES (6,'210000','辽宁省'); INSERT INTO hat_province VALUES (7,'220000','吉林省'); INSERT INTO hat_province VALUES (8,'230000','黑龙江省'); ....... INSERT INTO hat_city VALUES (5,'130100','石家庄市','130000'); INSERT INTO hat_city VALUES (6,'130200','唐山市','130000'); INSERT INTO hat_city VALUES (7,'130300','秦皇岛市','130000'); INSERT INTO hat_city VALUES (8,'130400','邯郸市','130000'); INSERT INTO hat_city VALUES (9,'130500','邢台市','130000'); INSERT INTO hat_city VALUES (10,'130600','保定市','130000'); INSERT INTO hat_city VALUES (11,'130700','张家口市','130000'); ....... INSERT INTO hat_zone VALUES (1,'110101','东城区','110100'); INSERT INTO hat_zone VALUES (2,'110102','西城区','110100'); INSERT INTO hat_zone VALUES (3,'110103','崇文区','110100'); INSERT INTO hat_zone VALUES (4,'110104','宣武区','110100'); INSERT INTO hat_zone VALUES (5,'110105','朝阳区','110100'); INSERT INTO hat_zone VALUES (6,'110106','丰台区','110100'); INSERT INTO hat_zone VALUES (7,'110107','石景山区','110100'); INSERT INTO hat_zone VALUES (8,'110108','海淀区','110100'); INSERT INTO hat_zone VALUES (9,'110109','门头沟区','110100'); INSERT INTO hat_zone VALUES (10,'110111','房山区','110100');
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值