J.R.
-Original Message-
From: Peter Lauri [mailto:[EMAIL PROTECTED]
Sent: Monday, May 15, 2006 1:37 AM
To: mysql@lists.mysql.com
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
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
--
Newbie type question:
apostrophes ie. a ' single quote is not getting into the database
fields. So if I entererd in a PHP/MYSQL web page entry field: Sally's
Website. When I look directly into the column with the MYSQL cmdline I
see: Sally s Website. Below are the code snips I'm using(I
Try mysql_escape_string instead of addslashes.
Also, I'm not sure why you did it, but you don't need to include your entire
form in the PHP script and echo it. If you have PHP code before and after
the form, you could use this approach:
?php
// some pre-form code
?
Form
?php
// some post-form