I’m trying to do this:
SELECT * FROM library WHERE $cat IN (tags);
Say that I have $cat = '15'; and tags is a fieldname in library that looks like this: 2,15,34, 45
How can I get it to work? I understand that normally the $var should be after the IN ($var), but the imploded array sits in my DB and not in the $var – somehow I’ve gotten it the wrong way around and I just cannot figure it out – Please help me, I’m wasting days 🙂
You can use
FIND_IN_SETinstead, like this: