Issue
SELECT myTable.*, otherTable.foo, otherTable.bar...
how can we write above query in cakephp ? I tried this but didn't work.
$data = $this->Articles->find()->select(['Articles.*','Categories.name'])->innerJoineWith('Categories');
It giving me error near SELECT Fees.* AS
Fees__*.
So instead of that, I have to write all columns of the Article Table.
$data = $this->Articles->find()->select(['Articles.id','Articles.name','Articles.title','Articles.description','Categories.name'])->innerJoineWith('Categories');
is there any solution in cakephp? please tell me. Thank You.
Solution
$data = $this->Articles->find()
->select($this->Articles)
->select(['Categories.name'])
->innerJoineWith('Categories');
Answered By - 26vivek
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.