Log in

View Full Version : Query contains mismatched quotes



RRVARMA
04-16-2008, 08:45 AM
Hi,

Could u please help me in this.. When i run the query below, its showin an error as "Query contains mismatched quotes".. I think its because of the quote in the name of the customer.. but how to solve this problem.. please help.. Note: I've bolded and underlined the statement where i feel its wrong..

SELECT * FROM BILLING_2008
WHERE CUSTOMERNAME="CITIZEN'S WORLD" order by COUNTRY

the actual problem is tat its calling the records using a variable.. like this..

WHERE CUSTOMERNAME='$CUSTNAME'

and CITIZEN'S WORLD is one record from that table.. is thr any alternate way to display names like the one above ie, with quotes in between the words..??

thetestingsite
04-16-2008, 10:27 PM
You could use functions like mysql_real_escape or addcslashes or the like. I would go into more detail, but currently short on time at the moment.

Hope this helps.