You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND sectionDisabled=0 ORDER BY sectionOrder ASC' at line 1SQL error. [SELECT sectionID,sectionName FROM sections WHERE topSection= AND sectionDisabled=0 ORDER BY sectionOrder ASC;] Error no:1064