我正在尝试从具有三个选项的多个复选框中进行 SQL 搜索:
- 基本款
- 阿万卡多
- 期中
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
为此,我以这种方式使用 bindParam
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.
我相信我错过了一些东西,但看不到它。