I have to select all items from a MySQL table using PHP but from categories that the user is allowed to see. I've tried having all the categories in an array and then imploding them while using the IN statement in the SQL query (tried like 10 different methods with INT and STRING arrays) with no luck. The problem is that I'm getting dizzy while trying to figure out a somewhat complex (at least for me) JOIN statement.
I have the following tables:
As you can see, it should be pretty easy except that a user may have more than one category assigned to it. How can I show Helen in this example all the products and/or categories she can see in a single query?
Thanks in advance.