Extend conditions in order to be able to check multiple values (from an array) in database records containing multiple values

I have database field with, for example, the value “1,2,3” that comes from a group concat of a joined table. On the page I have multiple dynamic buttons which add values to an array onclick. This results in a value like this for example: 3,4,5 or 8,9,1,4 etc… these values come from the joined table.

Now I want to show all records that have

(db-field) 1,2,3 in (arr) 8,9,1,4 == true
(db-field) 1,2,3 in (arr) 3,4,5 == true

but don’t show

(db-field) 1,2,3 in (arr) 97,98,99 == false

Community Page
Last updated: