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 '6006153284487 FROM `tblProductPrice` AS `ProductPrice3` WHERE `ProductPrice3`.`P' at line 1 The statement was: SELECT COUNT(*) AS rowCount FROM (SELECT `ProductPrice3`.PriceID AS 6006153284487 FROM `tblProductPrice` AS `ProductPrice3` WHERE `ProductPrice3`.`ProductID` = :ProductID11 ORDER BY `ProductPrice3`.`MinQty`) AS countableList

Page 1 of 2