Time : 11:57:58 SQLSTATE[42000]: Syntax error or access violation: 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 'and customerNature in (8,14,15,16,17) group by description order by ds.id asc' at line 2 Raw SQL : select DATE_FORMAT(me.DATEOFEDITIONS,'%d %b %Y') as DATEOFEDITIONS,ds.type,ds.description,sum(ds.currentClosingBalance) as currentClosingBalance,sum(ds.addCopies) as addCopies,sum(ds.lessCopies) as lessCopies,sum(ds.balanceCopies) as balanceCopies,sum(ds.courierCopies) as courierCopies,sum(ds.govtCopies) as govtCopies,sum(ds.byHand) as byHandCopies,customerNature from dispatchstatement ds inner join magzineeditions me on me.MAGZINEEDITIONSID=ds.magzineeditions where ds.magzineeditions= and customerNature in (8,14,15,16,17) group by description order by ds.id asc Time : 09:13:43 SQLSTATE[42000]: Syntax error or access violation: 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 '' at line 1 Raw SQL : select SUBORDERSID,ADVERTISEBOOKINGID,ORDERNO,PARTY from suborders,advertisementbooking where suborders.ADVERTISEBOOKINGID=advertisementbooking.ADVERTISEMENTBOOKINGID and PAGENO=7 and MAGZINEEDITIONS=162 and PAGETITLE= Time : 09:05:26 SQLSTATE[42000]: Syntax error or access violation: 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 '' at line 1 Raw SQL : select SUBORDERSID,ADVERTISEBOOKINGID,ORDERNO,PARTY from suborders,advertisementbooking where suborders.ADVERTISEBOOKINGID=advertisementbooking.ADVERTISEMENTBOOKINGID and PAGENO=7 and MAGZINEEDITIONS=162 and PAGETITLE=