Left join from two columns

i have the query

$query = "SELECT s.team_id, s.teams, a.current_bid, a.current_bid_id, a.id, a.team1, a.title, a.team2, a.ends, a.starts, u.nick, b.bid, b.tagged, b.bidder, b.willwin, b.quantity, p.bid As proxybid, b.id As bid_id FROM " . $DBPrefix . "bids b
    LEFT JOIN " . $DBPrefix . "proxybid p ON (p.itemid = b.auction AND p.userid = b.bidder)
    LEFT JOIN " . $DBPrefix . "sports s ON (s.team_id = b.willwin)
    LEFT JOIN " . $DBPrefix . "auctions a ON (a.id = b.auction)
    LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.tagged)

i need to connect team1 and team2 to a table called sports so i can get there names which is in column called (teams) how do i do that i already connected sports to another table as u can see in the code, how do i go about this, thanks.

ok done did it this way incase some one else is searching

$query = "SELECT sss.team_id, sss.teams AS teams2, ss.team_id, ss.teams AS teams1, s.team_id, s.teams, a.current_bid, a.current_bid_id, a.id, a.team1, a.title, a.team2, a.ends, a.starts, u.nick, b.bid, b.tagged, b.bidder, b.willwin, b.quantity, p.bid As proxybid, b.id As bid_id FROM " . $DBPrefix . "bids b
    LEFT JOIN " . $DBPrefix . "proxybid p ON (p.itemid = b.auction AND p.userid = b.bidder)
    LEFT JOIN " . $DBPrefix . "sports s ON (s.team_id = b.willwin)
    LEFT JOIN " . $DBPrefix . "auctions a ON (a.id = b.auction)
    LEFT JOIN " . $DBPrefix . "sports ss ON (ss.team_id = a.team1)
    LEFT JOIN " . $DBPrefix . "sports sss ON (sss.team_id = a.team2)
    LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.tagged)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.