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 Price > 0 AND enabled = 1 AND productID != '' ORDER BY sort_order, name' at line 1 SQL query : SELECT productID, name, fu_articul, fu FROM SS_products where categoryID = AND Price > 0 AND enabled = 1 AND productID != '' ORDER BY sort_order, name