Yeah, that's what I meant. You have to link them somehow. In an earlier example, you had tag1, tag2, tag3 in your images table. This works, but only allows you 3 tags per image. With an association table, one image can have unlimited tags and one tag can be attached to unlimited images.Skara wrote:Ok, what do you mean by an association table between them? As in..
image: id, info, info, info
tag: id, name
assoc: imageid, tagid
?? Why not just have the two tables?
Massive Image Organizer
Moderator: General Moderators
- allspiritseve
- DevNet Resident
- Posts: 1174
- Joined: Thu Mar 06, 2008 8:23 am
- Location: Ann Arbor, MI (USA)
Re: Massive Image Organizer
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Massive Image Organizer
Why not just:
image: id, info, info, info
tag: image_id, name
Search for tag names JOINed on the image table and return DISTINCT image info.
image: id, info, info, info
tag: image_id, name
Search for tag names JOINed on the image table and return DISTINCT image info.
(#10850)
Re: Massive Image Organizer
Yeah, that was my question. I think this is a better solution.arborint wrote:Why not just:
image: id, info, info, info
tag: image_id, name
Search for tag names JOINed on the image table and return DISTINCT image info.
Also, when I said "tag1, tag2, tag3", I meant that to be a single TEXT block rather than three separate VARCHAR entities. The point being to fulltext search the column. But yeah, a separate table is a better solution. I just don't see the need to have a third association table.