MySQL query to manipulate varchar or text data types with an apostrophe (') in the data
Posted on 2004-03-31
I am trying to update data that has an apostrophe character ' in the character string like -- Dreamin' Out Loud , and Eatin' Right And Drinkin' Bad -- these are album titles. but when i use a sql query in MySQL such as the following:
set AlbumID = '17'
where Title = 'Eatin' Right And Drinkin' Bad';
I get the following error:
Error Code : 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 'Right And Drinkin' Bad'' at line 3
(0 ms taken)
I get the same error whenever I try to use queries involving data that has an apostrophe in it -- Children's books, Swingin' Blues, etc. Is there any other way i can perform such updates or retrieve such data? Thanks very much.