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 ') WHERE s.F_ACTIVE != 2 AND s.F_ACTIVE=1 AND s.F_VISIBLE_IN_MENU=1 ' at line 4