Im is working on an image sharing site and wants to implement image tagging.
I read Questions # 20856 and # 2504150
I have few problems approaching the above issues. First of all, it's easy to connect an image with a tag. However, retrieving images by tags is not so simple. Not easy, because you will need to get the image-to-tag relationship from one table, and then make a large query with a group of OR statements (one OR for each image).
Before I even explored the topic of tags, I started testing the following method:
These tables are as examples:
Table: Image Columns: ItemID, Title, Tags Table: Tag Columns: TagID, Name
The Tags column in the Image table takes a line with the tagID tag from the Tag table enclosed in a hyphen (-).
For instance:
-65-25-105-
Associates an image with TagID 65.25 and 105.
With this method, itβs easier for me to get images by tag, since I can get a TagID with one request and get all the images using another simple request, for example:
SELECT * FROM Image WHERE Tags LIKE %-65-%
So, if I use this method for tags,
How effective is it?
Is LIKE% -65-% query a slow process?
What problems can I face in the future?