OK, I want to do Flickr-style related tags, but this is too hard-core techie for me to pull off, I’ll need some help.

Let’s say I have a database with a table TAGS, a table OBJECTS and a table TAGS2OBJECTS. If given the ID of a TAG, how can I find a list of ID’s for related TAGS, in other words, tags that have been assigned to similar objects? Is it just a query or should I add some table or field to the tables?

0 thoughts on “

  1. Sounds like you want to establish a many to many relationship.

    SELECT objects.name FROM tags, objects, tags2objects WHERE objects.id = tags2objects.object_id AND tags2objects.tags_id AND tags.name = ‘foo’;

Leave a Reply to James Spahr Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s