What's your table structure. From your post, I am assuming it looks like this (I could be wrong):
productID productName categories
1 blah 1,2,11
2 blah2 3,5,6
3 blah3 2,7,9
4 blah4 2,7,9,11
If that is the case (and I'm not saying it is, but it's just what I've gathered from the post) then you've got some normalization to do.
It should look like this:
Making the queries much easier.
Let me know if I've misunderstood anything and sorry!