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 ') ORDER BY fdname ASC' at line 1SQL error. [SELECT * FROM folders WHERE (fdactive=1 AND fdsbid=) ORDER BY fdname ASC;] Error no:1064