I have tables
The field active in table2 contains value '0' or '1'
My relation in my model is
static $has_many = array(
array('table2', 'conditions' => array('active = ?' => array(0)))
);
Later I have to find all where
table2.active = '1'
But now I am getting error as:
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 0
Filename: lib/Relationship.php
for condition value should be scalar (string, number, boolean)
$has_many = array(
array('table2', 'conditions' => array('active' => 0))
);
You have to use array only when using IN condition in query only.