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 '' at line 1SELECT * FROM tb_nota WHERE tipo_geral_nt='NOTA_FILHA' AND tipo_espec_nt='strFAZENDA' AND idp_nt=