I am trying do a find statement to get the content accordingly
users(id, name, city_id)
visitors(id, user_id, visitor_id) // visitor_id also refers to users table
cities(id, name)
PHP
$visitor_data = $this->User->Visitor->find('all', array(
'conditions' => array('user_id' => 1),
'limit' => 10,
'order' => array('timestamp DESC'),
'contain' => array('VisitorDetails' => array(
'fields' => array('id', 'first_name', 'last_name', 'username', 'city_id'),
'contain' => array('City'))
)
));
I am getting an error:
SQL Error: 1054: Unknown column 'VisitorDetails.contain' in 'field list'
I want to get the Visitor Details City information