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
エラーを解決するにはどうすればよいですか?