Select CategoryKey, URL, CategoryName From Categories Where SubcategoryKey = and Hidden = 0 Order by SortOrder, CategoryName 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 Hidden = 0 Order by SortOrder, CategoryName' at line 1