SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Threaded View

  1. #1
    SitePoint Wizard mPeror's Avatar
    Join Date
    Mar 2005
    Location
    Saudi Arabia
    Posts
    1,725
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation How do you query this field? (simple questions)

    Say I have those three tables for a basic forum:
    Thread:
    - id [PK]
    (and a few other columns)

    user_thread:
    - id [PK]
    - thread_id [FK1]
    - user_id [Fk2]

    User:
    - id [PK]
    - name
    (and a few other columns)

    My questions here are basically:

    1) When I'm working with the "Thread" table in a query, what's the best way to fetch user name associated with that "Thread"? or should that be in a different query?

    2) Am I doing the relations correctly? to be honest, I don't know when I should have an intermediate table between related tables, I just guessed that.


    Your help is much appreciated
    Last edited by mPeror; Apr 6, 2008 at 05:35.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •