1064 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 '?sorting=priceASC?sorting=priceASC?sorting=priceASC) ORDER BY final_price DESC, ' at line 5
in:
[SELECT DISTINCT products_sx_id FROM products_to_categories ptc, products_description pd,
(SELECT 1-s.specials_new_products_price/p.products_price as discount, p.products_id, p.products_sx_id, COUNT(DISTINCT products_sx_id),IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status =1, s.specials_new_products_price, p.products_price) as final_price FROM products_collection pcoll, products p left join specials s on p.products_id = s.products_id where pcoll.products_collection LIKE '%~Leather~%' and pcoll.products_collection_id = p.products_collection_id and pcoll.products_collection LIKE '%~Chuck Taylor All Star~%' and pcoll.products_collection_id = p.products_collection_id and pcoll.products_collection LIKE '%~Mid Tops~%' and pcoll.products_collection_id = p.products_collection_id GROUP BY products_sx_id) psx
where ptc.products_id = psx.products_id
and ptc.products_id = pd.products_id
and psx.discount > 0.3and ptc.categories_id IN (3?sorting=priceASC?sorting=priceASC?sorting=priceASC) ORDER BY final_price DESC, pd.products_viewed DESC, pd.products_id DESC limit 0,12]