I have an SQL table that looks like this:
id_question (int) | tags (varchar)
where the "tags" field is located - empty: NULL
- either filled with a single value (example: 1) (non-numeric)
- or filled with several values separated by commas (for example: 273,2308,24) (non-numeric)
id_question (int) | tags (varchar)
1 | 1,373
2 | 283.4555,308,12
3 | 283.25.3
I have an array of blacklisted_tags. I would like to get id_questions of all questions whose tag field does not matter in the $ tags_blacklist blacklist.
For example:
$ tags_blacklist = array (1,3)
=> I should get 2
and not 1, because in the tag field 1 and not 3, because in the tag field 3.
What should my SQL query look like?
source
share