Re: inserting quotes into a database...

From: Date: Thu, 03 May 2001 15:35:26 +0000
Subject: Re: inserting quotes into a database...
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-7261@lists.php.net to get a copy of this message
Turn on the magic_quotes_sybase setting in your php.ini file. Or, if you prefer to do it manually, replace all single quotes in the fields with two consecutive single quotes. Andrian Kelvin Luck wrote: > > Hi, > I am having trouble inserting single quotes into an mssql database... my > queries are taking the form: > > mssql_query("update discussiontopics set comment = '$comment', title = > '$title', zoneid = $zoneID where topicid = $topicID"); > > If $comment or $title contain any single quote characters I get an sql > error. I thought that addSlashes() was meant to avoid these problems but it > hasn't helped me... Neither has quotemeta()... Are there any other hint's > for inserting single quotes into mssql databases? > tia, > > Kelvin. > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.windows (#7261) next »