Invalid query 2: SELECT SERVICES_ID,PARENT_ID, NAME, TITLE FROM SERVICES WHERE SERVICES_ID= AND PARENT_ID=0 AND statusN='1' ORDER BY ORDER_, NAME 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 PARENT_ID=0 AND statusN='1' ORDER BY ORDER_, NAME' at line 1