I’m implementing a Tag system…
Currently i have the table tags with name, description, createdby fields.
And the table images that have a field tags. Inside this field i will put the tags name from the table tags, separated by comma.
But, if i want to get all images with tag Foo how i do form the query? since the field will contain multiple tags separated by comma.
Not sure if you have thought about normalizing the images table, but that would be the optimal solution here.
Instead of having
Structure your table this way
Then you can run this SQL statement to return all images with a certain tag
Or if there is a reason you need to keep your table in the current format, you can use
The word ‘forest’ in the above 2 examples is the tag you are searching for