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 c1.id_voce2 = OR c1.id_voce3 = OR c1.id_altri1 = OR c1.id_altri2 = OR c1.' at line 1