/productList.php - line: 312 Database ERROR: 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 's day' AND NotStockFound >= '1' AND RetailPrice >= '40' AND RetailPrice <= '4' at line 1
: SELECT SQL_CALC_FOUND_ROWS Pc.ProductCatalogueID, Pc.ProductTitle, Pp.TradePrice AS ProductTrade, Pp.RetailPrice AS ProductRetail FROM ProductCatalogue Pc LEFT JOIN (SELECT ProductCatalogueID, ROUND(IFNULL(TradePrice, 0),2) AS TradePrice, ROUND(IFNULL(RetailPrice, 0),2) AS RetailPrice FROM Products GROUP BY ProductCatalogueID ORDER BY RetailPrice DESC) Pp ON Pp.ProductCatalogueID = Pc.ProductCatalogueID LEFT JOIN Op_ProductCategories Oc ON Oc.CategoryID = Pc.CategoryID LEFT JOIN Op_ProductSubCategories Osc ON Osc.SubCategoryID = Pc.SubCategoryID LEFT JOIN (SELECT DISTINCT ProductCatalogueID, COUNT(ProductCatalogueID) AS NotStockFound FROM Products WHERE StockStatus != '4' GROUP BY ProductCatalogueID) Ps ON Ps.ProductCatalogueID = Pc.ProductCatalogueID WHERE Pc.ProductCatalogueID != '0' AND Oc.CategoryName = 'valentine' AND Pc.CategoryID NOT IN ('20','16') AND Osc.SubCategoryName = ''s day' AND NotStockFound >= '1' AND RetailPrice >= '40' AND RetailPrice <= '49.99' ORDER BY RetailPrice ASC LIMIT 0, 20