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 a.season_id = and a.gp > 0 and d.id = 37 and c.id <> 48 and a.pl' at line 5