MySQL Forums
Forum List  »  PHP

trouble figuring out joins, any gurus out there?
Posted by: Mike M
Date: August 31, 2009 11:23AM

I am trying to do some kind of join but I'm not sure the difference and which one I should be using.

I have the following tables

- todo_id
- title
(6, do yard work)
(7, do something at work)

todo_tag (links todo to tags, each task can have more than one tag)
- todo_id
- tag_id
(6, 3)
(6, 5)
(7, 4)

- tag_id
- value
(3, home)
(4, work)
(5, yard)

project (all a project is is a group of tags and we list all the todos that have one of those tags)
- project_id
- project name
(1, my home projects)
(2, someone elses project)

- project_id
- tag_id
(1, 3)

All the info I have is a project_id (1) and from that I want to get all the tags connected to the todos that have that the project tag (home). the tags I should get from the query are: 3,5

any direction would be appreciated

Options: ReplyQuote

Written By
trouble figuring out joins, any gurus out there?
August 31, 2009 11:23AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.