【发布时间】:2020-12-08 07:31:23
【问题描述】:
我正在尝试获取所有用户,为此我正在使用分页。
public function index()
{
$this->paginate = [
'contain' => ['Groups']
];
$users = $this->paginate($this->Users);
$this->set(compact('users'));
$this->set('_serialize', ['users']);
}
但是在$this->paginate 之后我得到了一个
Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups Groups ON Groups.id = (Users.group_id) LIMIT 20 OFFSET 0' at line 1
找不到导致此问题的原因。
有人知道我为什么会遇到这个问题吗?
【问题讨论】:
标签: php mysql sql-server cakephp pagination