10. Satya Prakash & co PDF Download - Download it once & read it online later.
Category:English-language books
Category:Electrodynamics
Category:S. Chand and Co. booksQ:
Cakephp throwing exception: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near '='
I'm having a problem with my cakephp app.
I have two tables in my database, users and jobs.
Each user can have multiple jobs, and each job has an associated user.
I'm using this piece of code to get all users in the users table with their jobs, this is working fine:
$users = $this->Users->find('all', array(
'fields' => array('Users.id, Users.userName, Users.password'),
'joins' => array('JOIN users_jobs ON users_jobs.user_id = users.id',
'LEFT OUTER JOIN jobs ON jobs.id = users_jobs.job_id')
));
But when i'm trying to get only the users with their jobs and not all of their jobs, I'm getting this error:
Error: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near '='.
I'm using this code:
$users = $this->Users->find('all', array(
'fields' => array('Users.id, Users.userName, Users.password'),
'joins' => array('JOIN users_jobs ON users_jobs.user_id = users.id',
'LEFT OUTER JOIN jobs ON jobs.id = users_jobs.job_id'),
'conditions' => array('Users.id=users_jobs.user_id', 'JOIN users_jobs ON users_jobs.job_id = jobs.id') be359ba680
Related links:
Comments