Re: Special characters --> single quote

From: Date: Tue, 22 Aug 2000 16:11:46 +0000
Subject: Re: Special characters --> single quote
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-12967@lists.php.net to get a copy of this message
OK, Jason In fact, your function is the better because it is the response of my question. Sorry for this misunterstood. I had believed read " instead of ' ' So you are truth. In the database, there is only one single quote when I record this ' ' So I have tried your function and it works !!!!!!!!!!!!!!!!!!!!!!!! :-)))))))))))))) Thank you very much Jason. Ludovic Jason Brooke a écrit : > It's all I ever do. > > But in the event I thought I was also going to be accessing a database from some other language > that > didn't have the ability to strip the slashes, I'd probably delimit the single quotes > with another > single quote, using str_replace(). The end result is that your database field is left with the > originally-intended single occurance of the single quotes. > > I'm not sure why ludovic decided he'd just go with double quotes instead of the above > if it was so > disturbing to him to use double quotes - particularly when there's no difference between > replacing > all occurances of single quotes with double quotes, or replacing them with 2 single quotes. > I think str_replace() is a pretty quick function, it's not like it's regex. > > jason > > I'm sure this is a worn out topic here, but this generally seems to be a tricky issue. If > you are > only working within PHP, addslashes(), stripslashes() solves the problem, but when the database > must > be shared with other applications, the slashes themselves present a problem. I've been > working > with an AS/400 for years, and this hasn't been an issue because the database is built into > the > programming languages, and there isn't any parsing of the data itself. The only time we > run into > this on the AS/400 is when we pull out a .csv file and there are quote on the date. I'm > sure this is > a more general SQL issue, so is this (addslashes/stripslashes) what everyone does in the SQL > world? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#12967) next »