This function is working on OR condition. I need this to work with AND condition. Any help:
$ands = array();
foreach ($array_training_id as $id) {
$ands[
The easiest approach would be, to create a habtm-relation.
Then you can do:
$users = $this->User->Training->find('all', array('conditions' => array('User.id =' => $ids)));
This finds all where User.id = $id
With your AND-condition, it would be:
$users = $this->User->Training->find('all', array('conditions' =>
'AND' => array('User.id =' => $ids['n'], 'User.id =' => $ids['n'])
));