Time : 12:09:22 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 Enteprises' and ADD1='Opp. Tata Motors, Bellary Road'' at line 1 Raw SQL : select PARTYID from partydetail,contact where PARTYID=PARTY and CITY=953 and NAME='Khan's Enteprises' and ADD1='Opp. Tata Motors, Bellary Road' Time : 12:00: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 's Enteprises' and ADD1='Opp. Tata Motors, Bellary Road'' at line 1 Raw SQL : select PARTYID from partydetail,contact where PARTYID=PARTY and CITY=953 and NAME='Khan's Enteprises' and ADD1='Opp. Tata Motors, Bellary Road' Time : 11:58:32 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='Opp. Tata Motors, Bellary Road'' at line 1 Raw SQL : select PARTYID from partydetail,contact where PARTYID=PARTY and CITY=953 and NAME='Khans's Enterprises' and ADD1='Opp. Tata Motors, Bellary Road'