List:General Discussion« Previous MessageNext Message »
From:J.R. Bullington Date:May 15 2006 6:34am
Subject:RE: Inserting ' into database
View as plain text  
As a word of advice, before posting to any list, please RTFM (Read The Fine
Manual).

You have to escape all "special characters", like apostrophes and single
quotes, with the backslash.

INSERT INTO thetable (name) VALUES ('O\'Connell');

http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html

J.R.

-----Original Message-----
From: Peter Lauri [mailto:peter@stripped] 
Sent: Monday, May 15, 2006 1:37 AM
To: mysql@stripped
Subject: Inserting ' into database

Hi all,

Assume that I want to insert "Juanita O'Connell" into my database. How do I
do that? The problem is the ' in her last name. If I just put it in it will
be

INSERT INTO thetable (name) VALUES ('O'Connell');

And that does not work :) How can I solve this?

Best regards,
Peter Lauri


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1


Attachment: [application/x-pkcs7-signature] smime.p7s
Attachment: [application/x-pkcs7-signature] smime.p7s
Thread
Inserting ' into databasePeter Lauri15 May
RE: Inserting ' into databaseJ.R. Bullington15 May