2
I have a search with several checkboxes that can be selected and added dynamically by the user. Since I don’t know the amount, I was thinking of doing the following: go through all of them and concatenate with AND
and use it in the condition there in the search.
The problem is that the way I did it ends up being one AND
alone at the end of the search. Follow my code:
$Busca = $_POST['txtbusca'];
$arrayFiltro = $_POST['chkDisciplina'];
for ($i=0; $i < count($arrayFiltro); $i++) {
echo $arrayFiltro[$i]. "AND";
}
There’s a better way?
Post your SQL that should be generated with this search filter?
– user6026