[eluser]matyhaty[/eluser]
Where-Related issues:
Im creating a person search, which will search all persons in the system, for one or multiple qualifications that they have.
The relationship of the qualifications is:
Person relates to Qualifications
Qualifications related to Qualification Types
Thus, using a multiselect I process the selected qualification types required:
Code:
$selected = array();
foreach ($this->input->post('qualifications') as $val)
{
$selected[] = $val;
}
I then query all persons (which is $p->persons) using where_related - to only get persons who have ALL of the requested qualification types.
Code:
$p->person->where_related('qualification/qualificationtype', 'id', $selected);
This works fine, but gives me a OR operator (e.g. select * from blah blah where related_id = 1 || related_id = 2 || related_id = 3....) for all the qualification type IDs. How can this be done for AND?
Many Thanks