query assoc error: select c.RosterID,c.RosterID from clubgamestartingroster c inner join competitionstageclubrosters ccr on(c.RosterID = ccr.RosterID) inner join seasons s on(ccr.SeasonID = s.SeasonID) where c.GameID = 3228549 and ccr.ClubTeamID = and ccr.CompetitionStageID = 3228370 and s.CurrentSeason = 1 Order by ClubGameStartingRosterID limit 11 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and ccr.CompetitionStageID = 3228370 and s.CurrentSeason = 1 Order by ClubGameS' at line 1