I'm trying to print the data from that query where the bstockBooksTableResearchIds is equal array(1,2,3) , but i'm getting error showing in bellow :
$bstockBooksTableResearches = $this->BstockIn->BstockResearchs->find('list', [
'conditions' => ['BstockResearchs.id' => $bstockBooksTableResearchIds],
]) ;
try this:
$bstockBooksTableResearches = $this->BstockIn->BstockResearchs->find('list', array(
'conditions' =>array (
'BstockResearchs.id' => $bstockBooksTableResearchIds),
)) ;
changes: IN clause should be in array.
you should add IN
in your conditions so your code will be
$bstockBooksTableResearches = $this->BstockIn->BstockResearchs->find('list', [
'conditions' => [
'BstockResearchs.id IN' => $bstockBooksTableResearchIds
]
]) ;