help escaping apostrophes for mysql

From: Date: Sat, 28 Oct 2000 21:24:16 +0000
Subject: help escaping apostrophes for mysql
Groups: php.db 
Request: Send a blank email to php-db+get-4012@lists.php.net to get a copy of this message
Hi All, I am developing a simple address book using PHP and MySQL on a UNIX box running Apache. I'm getting errors when I try to add a record that has an apostrophe ( ' ) in it. For example: when I go to my add_record.html file, which contains a form with text fields to populate a new record, and I type Nick's Books in one of the fields and submit the record ... which calls my add_record.php file which has the neccesary INSERT command to create the record, I get an error. Any idea why? I know this has something to do with adding data with an apostrophe in it, but I don't know to avoid this ... escape the user-entered apostrophe, etc. Help! Nick

« previous php.db (#4012) next »