Where multiselect filter on array
Where multiselect filter on array
I have a multiselect filter which works great if a specifc id has only one value allocated.
account_mm:
id iso_01
1 DE
2 DE
3 FR
4 FR
5 US
But what if a specifc id has multiple values like:
account_mm
id iso_01
1 DE
2 DE
3 FR, DE
4 FR, DE, US
5 US
I tried this but no result:
$id->or_where( 'account_mm.iso_01', '%'.$_POST["selectID"].'%'[$i], 'LIKE' );
I also tried ....
$id->or_where( 'account_mm.iso_01', $_POST["%selectID%"][$i], 'LIKE' );
... which does some filtering but shows all the rows with a value in it.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
A combination of the first two:
You want it to look like
WHERE account_mm.iso_01 LIKE '%searchTerm%'
eventually.Allan
Perfect ... this works for me. Many thanks