Time : 10:53: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 's Enterprises' and ADD1='5, B.N. Road,'' at line 1 Raw SQL : select PARTYID from partydetail,contact where PARTYID=PARTY and CITY=1324 and NAME='Neelam's Enterprises' and ADD1='5, B.N. Road,' Time : 06:25:09 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=6 and MAGZINEEDITIONS=154 and PAGETITLE=