如何实现三级联动PHP AJAX MySQL数据库交互?
- 内容介绍
- 文章标签
- 相关推荐
本文共计204个文字,预计阅读时间需要1分钟。
php三级行动 + PHP: WHERE('ParentId=1') SELECT(); $this->assign('area', $area); $this->display();public function getCity() { $ParentId=I('post.ParentId'); $current_city=M('citys')->where(ParentId=$ParentId)->select(); $data['data']=$current_city;}
三级联动php: where('ParentId=1')->select(); $this->assign('area',$area); $this->display(); } public function getCity(){ $ParentId=I('post.ParentId'); $current_city=M('citys')->where('ParentId='.$ParentId)->select(); $data['data']=$current_city; $this->ajaxReturn($data); } public function getCounty(){ $ParentId=I('post.ParentId'); $current_county=M('citys')->where('ParentId='.$ParentId)->select(); $data['data']=$current_county; $this->ajaxReturn($data); } } html:
三级联动
本文共计204个文字,预计阅读时间需要1分钟。
php三级行动 + PHP: WHERE('ParentId=1') SELECT(); $this->assign('area', $area); $this->display();public function getCity() { $ParentId=I('post.ParentId'); $current_city=M('citys')->where(ParentId=$ParentId)->select(); $data['data']=$current_city;}
三级联动php: where('ParentId=1')->select(); $this->assign('area',$area); $this->display(); } public function getCity(){ $ParentId=I('post.ParentId'); $current_city=M('citys')->where('ParentId='.$ParentId)->select(); $data['data']=$current_city; $this->ajaxReturn($data); } public function getCounty(){ $ParentId=I('post.ParentId'); $current_county=M('citys')->where('ParentId='.$ParentId)->select(); $data['data']=$current_county; $this->ajaxReturn($data); } } html:

