tags:

views:

52

answers:

1

I've been trying left joins but as there are 2 joins, i think the problem is the 2nd join roots from table_B not table_A. i am not getting any results where there is the required data in the db. I am not getting a query error

the query (simplified)

SELECT events.*, ven.*, events_genres.*
  FROM events
    LEFT JOIN ven                                   //OPTIONAL JOIN
      ON events.ven_id = ven.ven_id                   //OPTIONAL JOIN
    LEFT JOIN events_genres                         //REQUIRED JOIN
      ON events.event_id = events_genres.event_id     //REQUIRED JOIN

  WHERE events.date >= '$this->now'     
    AND events_genres.g_id = $g_id                //REQUIRED MATCH

  ORDER BY date

ven = optional, i'll have the info if its there.

events_genres = required, i dont want any results that do not have a genre

+1  A: 

disregard... mix between SQL version thoughts

DRapp