I have a string array in PHP called groups. The array looks something like this based on user input: groups[All, Sales].
Example: (UPDATED TABLE SCHEMA)
groups[] = ['Sales', 'All']
ANNOUNCEMENT
|description|masterID| groupName |
=======================================
| hello | 1 | All, Final, |
| greetings | 2 | Sales, All, |
| demo | 3 | Final, |
So from above table it should only return "hello" and "greetings" as output because groups[] has Sales and All as row 1 has All and row 2 has both. Please help. I am an amateur in SQL and PHP both.
My current try:
SELECT * FROM announcement WHERE groupName REGEXP '(Sales | All)'
Output:
No rows affected