SELECT GROUP_CONCAT(CONCAT(wacdb_livematches._player1, IF(wacdb_livematches._action = 'autogoal', ' (autogoal)', IF(wacdb_livematches._action = 'penalty', ' (rigore)', ''))) SEPARATOR ', ') as scorers FROM wacdb_livematches WHERE wacdb_livematches._match = 116310 AND wacdb_livematches._club = AND (wacdb_livematches._action = 'goal' OR wacdb_livematches._action = 'autogoal' OR wacdb_livematches._action = 'penalty') GROUP BY wacdb_livematches._club --- 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 'AND (wacdb_livematches._action = 'goal' OR wacdb_livematches._action = 'autogoal' at line 1 ---