I have a table called articles and I would like to retrieve all articles that contain a tag, in the articleTags field. The articleTags field contains a set of comma delimited strings (the tags).
If I am trying to find an article that contains the tag php from a table it should return results that had a articleTags field that looks like this –
- php
- c++,php,python
If I was doing this in PHP, I would simple use explode, but I don’t want to go through every row in the database, and instead use a more efficient method.
you could use the like operator
if you are worried about tags which are not php but have php in them like say phphp then you can use with comma