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 'OR articles.team2_id = OR articles.tags LIKE '%%') AND articles.status = 'publi' at line 1