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 'AND RELTIP.cd_tipo= AND RELTIP.cd_tipo=1 AND RELCAT.cd_categ= AND RELTIP.cd_tipo' at line 5You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND RELTIP.cd_tipo= AND RELTIP.cd_tipo=1 AND RELCAT.cd_categ= AND RELTIP.cd_tipo' at line 12