I am trying to load another model in one default model. I have a profiles table in my database. but getting error.
User model
App::uses('AuthComponent', 'Controller/Component');
class User extends AppModel {
public function getProfileData(){
$this->loadModel('Profile');
$profileData = $this->Profile->findById('8');
print_r($profileData);
}
}
Error :
Error: SQLSTATE[42000]: 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 'loadModel' at line 1
SQL Query: loadModel