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 TXT_TYPE=3 LIMIT 1' at line 1SELECT * FROM alff_rsdoc WHERE TXT_KATEGORY= AND TXT_TYPE=3 LIMIT 1