RE: [PHP-DB] Addslashes (MSSQL)

From: Date: Thu, 20 Mar 2003 16:23:15 +0000
Subject: RE: [PHP-DB] Addslashes (MSSQL)
Groups: php.db 
Request: Send a blank email to php-db+get-26518@lists.php.net to get a copy of this message
Actually, that eliminated the error messages but it still hasn't fix the problem I did what you said....but now in my MSSQL table, the content column has somethign like thsi "Step 1: blah blah balh Step 2: blah balh balh \'Username\'" so it included the slashes...I just learned that mSSQL doens;t accept slashes so is there any other way I can fix this problem?..I want literally step 1: balh bah balh Step 2: balhb alhb alhb 'Username' to be inserted to the table..please help thanks a lot by the way -----Original Message----- From: CPT John W. Holmes [mailto:holmes072000@charter.net] Sent: Thursday, March 20, 2003 11:06 AM To: Poon, Kelvin (Infomart); php-db@lists.php.net Subject: Re: [PHP-DB] Addslashes (MSSQL) > where my $content value is osmethign like this. > > "Step 1: Access the homepage > Step 2: type in your username under the field 'username' " > > and after the addslashes funciton there would be \ around the 'username' > like this.. > \'username\'....and now after running this program I got an error message: > > Warning: MS SQL message: Line 14: Incorrect syntax near 'username'. > (severity 15) in d:\apache_docroots\internal.infomart.ca\infodesk\kb_add.php > on line 119 I think you need to replace ' with '' in MSSQL (one single quote replaced with two single quotes) $text = str_replace("'","''",$old_text); ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#26518) next »