SELECT games_soccer.* FROM games_soccer WHERE champ_id = '' AND status_type = 'finished' AND ( home_team_id IN(, ) or away_team_id IN(, ) ) AND games_soccer.status_desc != 'deleted' : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' ) or away_team_id IN(, ) ) AND games_soccer.status_desc != 'deleted'' at line 12