another approach is using the str_replace() function, just replace the single quote ' with two single quotes '' and database inserts should be fine.
http://www.php.net/manual/en/function.str-replace.php Regards, Sherwin Ang Web Programmer / Systems Administrator Alchemy Solutions http://www.alchemy.com.ph Creative. Technology. Tridel Technologies, Inc. 7th Floor Hanston Building Emerald Ave., Ortigas Center Pasig City Tel: (632) 634-5141/ (632) 634-5140 Fax: (632) 634-5139 ----- Original Message ----- From: "Gurhan Ozen" <[EMAIL PROTECTED]> To: "Tim Thorburn" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, January 09, 2002 11:59 AM Subject: RE: apostrophe's in PHP & MySQL > Hi Tim, > You can get around that proble using AddSlashes() function in PHP. So is you > have a text box where the users enter their inputs, say assigned to the > variable $feedback then , before entering it into mysql, you will have to > apply AddSlashes() on it. So do something like > $feedback=AddSlashes($feedback); > > Refer to http://www.php.net/manual/en/function.addslashes.php if you need > to see more info. > > Gurhan Ozen > MCI WorldCom > Quality Assurance Team > [EMAIL PROTECTED] > ph: 703-449-4754 > Vnet: 228-4754 > 1-800-PAGE-MCI pin: 1927052 > AIM: Greywolf1923 > > -----Original Message----- > From: Tim Thorburn [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 08, 2002 10:11 PM > To: [EMAIL PROTECTED] > Subject: apostrophe's in PHP & MySQL > > > Hi, > > I've been experiencing some sporadic problems with a few web forms written > in PHP 3.0.16 and MySQL 3.23.31 with text fields (both single lines and > rows). Generally if any of the text in these forms contains an apostrophe > - either nothing is entered into the database, or nothing after the > apostrophe is entered. > > Is there a way around this? Or is this a limitation of my older versions > of PHP and MySQL? > > Thanks > -Tim > > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail > <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php