I'm trying to do an SQL search from a multiple checkbox with three options :
- Basico
- Avancado
- Interm
When the two first options are selected I suppose i'll have something like this :
SELECT *
FROM candidates
WHERE catiav4 LIKE %Avançado%
OR catiav4 LIKE %Basico%
ORDER BY candidate_id DESC
LIMIT :debut,20
For that need I use bindParam this way
if ($metier13 != ''){
$metier13=implode("% OR catiav4 LIKE %",$metier13);
$metier13="%$metier13%";
$retour->bindParam(':catiav4', $metier13, PDO::PARAM_STR);}
It works fine when only one checkbox is selected, but when two are selected it does not return any results.
I believe I'm missing something but can't seen to find it.