DATABASE ERROR:

SELECT count(pr.id) as c
			FROM cms_easyshop_products pr
			LEFT JOIN cms_easyshop_categories cat ON (cat.id = category_id)
			 INNER JOIN cms_easyshop_product_chars epc17 ON(epc17.product_id = pr.id AND ((epc17.char_id=17 AND epc17.value_id=1040?ct17)))
			WHERE category_id="316" AND pr.published=1 AND cat.published =1

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 '?ct17))) WHERE category_id="316" AND pr.published=1 AND cat.published =1' at line 4