模糊查询
公共函數搜尋(){ $keyword = trim($_POST['$keyword']); $Model = M('admin'); $res= $map['使用者名稱'] = array('like','%'.$keyword .'%'); if($res){ ??#???????#?????? # }別的{### ?????????##
public function search(){ $keyword = trim(I('keyword ')); $map['username'] = array('like','%'.$keyword .'%');
$res=M('admin') ->where($map)- > select();
if($res){ $data['code']=1;
$data['data']=$res } # $data['data']=$res;
##$ ##
public function search(){ $keyword = trim(I('keyword ')); $map['username'] = array('like','%'.$keyword .'%');
$res=M('admin') ->where($map)- > select();
if($res){ $data['code']=1;
$data['data']=$res } # $data['data']=$res;
##res } # else{ $data['code']=0; $data['msg']='沒有資料';# }##$ ##