Error: 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 'ORDER BY p.date_added DESC LIMIT 5' at line 1
Error No: 1064
SELECT *, pd.name AS name, p.image,s.name AS storename,s.url, m.name AS manufacturer, ss.name AS stock, (SELECT AVG(r.rating) FROM review r WHERE p.product_id = r.product_id GROUP BY r.product_id) AS rating FROM product p LEFT JOIN product_description pd ON (p.product_id = pd.product_id) LEFT JOIN product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN stock_status ss ON (p.stock_status_id = ss.stock_status_id) LEFT JOIN store s ON (s.store_id = p2s.store_id) WHERE p.status = '1' AND p.date_available <= NOW() AND pd.language_id = '1' AND ss.language_id = '1' and p2s.store_id= ORDER BY p.date_added DESC LIMIT 5