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 p.pr_mostrar_coleccion=1 ORDER BY p.pr_codigo, p.pr_nombre' at line 5