我想使用created
表中的字段检索 cakephp 中的最后 3 个注册用户Users
。
在我的控制器中,我有:
$this->User->recursive = 1;
$this->set('users',
$this->User->find('all',
array('conditions'=> array(
'limit' => 3,
'order' => array(
'created' => 'asc'
)
)
)
)
);
上面的代码在运行时返回此错误:
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 'order = ('asc')' at line
我必须怎么做才能解决错误?