I’m trying to code a way for users to “tag” other users in PHP/MySQL.
So far my idea is this:
- Create a table called “pictures”, and a field called “tagged”.
- Store a (serialized?) array in “tagged” which I can pull down with a sql query.
This seems like a really ugly way of handling the task – anyone have any suggestions for me?
If you’re looking to do Facebook-style tagging of people in photos (i.e. overlay on top of the photo), try this how-to article:
http://www.bryantan.info/jquery/facebook-like-photo-tagging-using-jquery-and-php/5
If you simply want to have a list of names next to the photo, create a many-to-many linking table. Example: