www.webdeveloper.com
Results 1 to 5 of 5

Thread: problem with JOIN

  1. #1
    Join Date
    Mar 2007
    Posts
    20

    problem with JOIN

    Code:
    SELECT ibf_members.name, ibf_forums.name 
    FROM ibf_members, ibf_forums, ibf_moderators 
    WHERE ibf_members.id=ibf_moderators.mid AND ibf_moderators.forum_id=ibf_forums.id
    when i try to run this query i want it to show me all the moderators names and the forum they are moderating
    but becouse both columns are called "name" it shows me in both columns the name of the forums that are moderated
    instad of showing me a column with the moderator names and a column with the moderated forums
    how can i fix this?
    tnx

  2. #2
    Join Date
    Dec 2006
    Location
    gold coast
    Posts
    34
    SELECT m.name, f.name
    FROM ibf_members as m
    inner join ibf_moderators md ON m.id = md.mid
    inner join ibf_forums f ON md.forum_id = f.id

  3. #3
    Join Date
    Mar 2007
    Posts
    20
    why does what i tried doesnt work?
    can u please explain?
    Thanks!

  4. #4
    Join Date
    Mar 2007
    Posts
    20
    and btw it still doesn't help
    wtf :S

  5. #5
    Join Date
    Mar 2007
    Posts
    20
    solved

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles