作为CakePHP的新手,我有这个错误:
解析错误:语法错误,意外T_DOUBLE_ARROW
我正在使用CakePHP 2.0,而在LogsController
我有:
$conditions = array("Title.id" => $id);
$currentUser = $this->Title->find('first', array('conditions' => $conditions), 'fields'=>array('user_id'));
任何想法,我怎么能解决这个问题?
答案 0 :(得分:4)
你应该在数组中放置'fields':
$currentUser = $this->Title->find('first', array('conditions' => $conditions, 'fields'=>array('user_id')));