filter conditions from an association
I have a search function, which works great for staff, so I can search by name. Now, I want filter staffs by staffgroup.groupname, but unfortunatelly i get this error: Column not found: 1054 Unknown column 'staffgroups.groupname' in 'where clause' I'm having the following tablelayout staffs (a person can belong to many groups) staff_staffgroups (HABTM-linking table) staffgroups (has a groupname) i used the conditions as follows: $tmpConditions['AND'][] = array('Staff.isActive =' => "1"); $tmpConditions['OR'][] = array('Staff.lastname LIKE' => "%$name%"); $tmpConditions['OR'][] = array(