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 '' at line 6 Query:SELECT G.nombre AS grupo, SG.nombre AS subgrupo, C.nombre_categoria FROM t_grupo G, t_subgrupo SG, t_categoria C WHERE G.idt_grupo = SG.idt_grupo_r AND SG.idt_subgrupo = C.idt_subgrupo_r AND C.idt_categoria =