错误如下:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') LIMIT 1' at line 1
代码如下:
$count = $m->count();
$p = new Think\Page($count,$rows);
$show = $p->show();
$list = $m->limit($p->firstRow,$p->listRows)->select();
for($i=0;$i<$rows;$i++){
$sales = $list[$i]['sales']; //循环取出每条数据置业顾问字段的值
$username = M('users')->field('u_name')->where('u_id='.$sales)->find();//根据置业顾问id查询出置业顾问的名字
$list[$i] = array_merge($list[$i],$username);//组装数组
}
$result = array('list'=>$list,'show'=>$show);
return $result;
求大神解答! 最佳答案
