I have a table on my database that lists different sections to show. We only want to show the sections if the user ID is inside a column of the database called ‘userAccess’ which will have a comma seperated list of the users who can see it.
Example row
id section userAccess
1 editNews 1,13,15
So how can I query that out and say something like
SELECT `section` WHERE '$userID' is in `userAccess`
I tried LIKE %, but obviously that will return all 3 users if I do LIKE %1%.
1 Answer