While creating the user in wordpress there is a list of checkboxes and i am storing id values of the checked boxes as comma separated in user meta table like 1,5,6,8,10. etc..
| user_id | meta_key | meta_value |
---------------------------------
| 1 | service | 1,4,5,10 |
| 2 | service | 4,5,6 |
Now i am working on search functionality along with first name and city where i have to get the list of users.
So there is the same list of checkboxes which is in when creating user. here i have to get the checked values and search it in the meta values in usermeta table which is stored as a comma separated and get the matching users.
example: meta key is Profession and value stored is say for user_1 1,4,5,10 and user_2 is 4,5,6.
Now if from the search 1,4 value is checked then it should return the user. in this case it should return user1 and user2.
If i search for 1,10 is checked it will return only user1.
Currently i am executing custom query to get the user.
Please help me to match value to comma separated meta values to get the users.
Thank you.