Re: Addslashes (MSSQL)

From: Date: Thu, 20 Mar 2003 16:06:14 +0000
Subject: Re: Addslashes (MSSQL)
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-26517@lists.php.net to get a copy of this message
> 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...

« previous php.db (#26517) next »