I have a relation MANY to MANY from the tables ‘division’ and ‘person’, ‘divison’ relation is ‘people’.
I write this part of code to obtain all the people that work inside one division and put it in the gridView
$dataProvider=new CActiveDataProvider('division', array( 'criteria'=>array( 'condition'=>'id=:id', 'params'=>array(':id'=>23), 'with'=>array('people'), ), 'pagination'=>array( 'pageSize'=>20, ), ) );
the browser says:
CDbCommand failed to execute the SQL statement: SQLSTATE: Integrity constraint violation: 1052 Column ‘id’ in where clause is ambiguous. The SQL statement executed was: SELECT COUNT(DISTINCT
t LEFT OUTER JOIN
people_people ON (
division_id) LEFT OUTER JOIN
people ON (
person_id) WHERE (id=:id)
how can I resolve it?