Tom
Tom

Reputation: 336

CakePHP: Parse error: syntax error, unexpected T_DOUBLE_ARROW

As a CakePHP novice, I'm having this error:

Parse error: syntax error, unexpected T_DOUBLE_ARROW

I'm using CakePHP 2.0 and in my LogsController I have:

$conditions = array("Title.id" => $id);
$currentUser = $this->Title->find('first', array('conditions' => $conditions), 'fields'=>array('user_id'));

Any idea, how I could solve this?

Upvotes: 1

Views: 1881

Answers (1)

topek
topek

Reputation: 18979

You should place 'fields' in the array:

$currentUser = $this->Title->find('first', array('conditions' => $conditions, 'fields'=>array('user_id')));

Upvotes: 4

Related Questions