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 'Where b.team_id = 41 and b.season_id = and b.IsActivated = 1 and b.date_' at line 5