$a...">

Cakephp condition with LIKE operator: how to handle multiple values

Hi, I am trying to fulfill this condition:

array("Curriculum.name LIKE" => $array,"Curriculum.surname LIKE" => $array,) 

But cakephp's output is as follows:

 WHERE ((`Curriculum`.`name` LIKE IN ('%jon%','%x%')) OR (`Curriculum`.`surname` LIKE IN ('%jon%','%x%')) 

Any idea how to achieve this?

+7
source share
1 answer
 foreach ($array as $name) { $conditions['or'][] = array('Curriculum.name LIKE' => "%$name%"); $conditions['or'][] = array('Curriculum.surname LIKE' => "%$name%"); } 
+18
source

All Articles