Connecting Tech Pros Worldwide Help | Site Map

How to seperate user input tags for image

Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,936
#1: Sep 26 '07
I'm making an image host and i'm wanting to add functionality to the host, so users can search the database for images.

I'm going to have a section for adding tags to the, soon to be, uploaded image.

"Tags for image; seperated by a comma ',' "

How would i seperate the tags so it wasn't put into the database as one long string.

I'm guessing it would use the explode() function?

Any ideas?

Cheers :)
MarkoKlacar's Avatar
Expert
 
Join Date: Aug 2007
Location: Stockholm, Sweden
Posts: 294
#2: Sep 27 '07

re: How to seperate user input tags for image


Hi,

explode() is a good start, but you still have to figure out how you will store you keywords. A solution, not saying that it's the best, would be to put the whole string in the DB and search for keywords in it.

The best and most practical would be to have a table for storing all the keywords and and the ID's for the images containing that keyword (could be a lot of images).

Hope this helps
Reply