View Single Post
Old 12-07-2007, 08:07 PM   #11 (permalink)
Gurnk
The Contributor
Upcoming Programmer 
 
Gurnk's Avatar
 
Join Date: Oct 2007
Location: US
Posts: 66
Thanks: 19
Gurnk is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
Sorry, completely missed your last question, Gurnk! Basically it's all down to the JOINs:
  1. Join picture.id to picture_categories.id based on WHERE clause (one to many);
  2. Join picture_categories.category_id to categories.id (many to many);
Key:
Blue = Table
Green = Column

So for every ID that matches to the picture's image in our lookup table, get all the IDs that match up to a categories in the categories table.
Ah nice one! I didn't know you could do stuff like table.column. Thanks for the tips.
Send a message via MSN to Gurnk
Gurnk is offline  
Reply With Quote