首页 > 后端开发 > php教程 > CI框架搜索中文后分页出错

CI框架搜索中文后分页出错

WBOY
发布: 2016-06-23 14:22:40
原创
933 人浏览过



如图:搜索中文分页出现错误,PHP处理代码我贴下面 求版主帮忙:

 会员列表 */    public function member_list(){  //会员列表        $this->userdoaction_model->getPower(MBMBERPOWER,$this->userinfo,POWER1);        $this->load->language('admin/member');        $condition['display'] = 15;        $data['lang'] = $this->lang->line('HtmlLanguages');        $data['option']=$this->group_model->getgroupmemberNM();        $data['options']=array                        ( 'null'=>$data['lang']['space'],                          '1'=>$data['lang']['s'],                          '0'=>$data['lang']['e']                        );       // sort($data['option']);       // $this->load->library('pagination');        //$config=$this->config->item('page');        //$config['base_url'] = base_url().$data['lang']['memberlist'];urlencode($kw)        if($this->input->post('dospost'))        {                $condition=array                    (                       'group_id'=>$this->input->post('gid'),                       'username'=>$this->input->post('username'),                       'status'  =>$this->input->post('status')                     );                //print_r($Sel);                $gid = $this->input->post('gid');                $status = $this->input->post('status');                $username = urlencode($this->input->post('username'));                $condition['display']=15;            $num = $this->member_model->Selcount($condition);	        $url = base_url()."/index.php/admin/member_list/";			$this->page->select = $gid."_".$status."_".$username;	        $this->page_model->page($num,"15",1,$url);	        $data['gid'] = $this->input->post('gid');	        $data['username'] = $this->input->post('username');	        $data['status'] = $this->input->post('status');	        $data['page']=$this->page->pagenav;	        $data['user'] = $this->member_model->Selmember($condition);        }else{        	error_reporting(E_ALL);			$num = $this->member_model->countlist();;	        $url = base_url()."/index.php/admin/member_list/";			$this->page->select = '0_null_0';	        $this->page_model->page($num,"15",1,$url);	        $data['page']=$this->page->pagenav;	       // print_r($condition);	        $data['user'] = $this->member_model->member_list($condition);         }         $this->load->view('admin/member_list',$data);
登录后复制


回复讨论(解决方案)

@xuzuning 求教

有大神帮忙看看吗

注意看它的错误信息
$total_rows 变量没定义

注意看它的错误信息
$total_rows 变量没定义 我在变量前面+@了 

主要的问题是 传递汉字参数分页出错 (谢谢你哈,帮我回答好多次)

你的代码没贴全,错误提示也贴出来。

解决了!
用iconv 有时候失效了! 用以下代码:


$a=urldecode("%E5%90%89%E6%9E%97");
$a=mb_convert_encoding($a, 'GB2312', 'UTF-8'); 
echo $a;
?>

来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板