Re: note 11223 added to str_replace

From: Date: Mon, 12 Feb 2001 10:58:56 +0000
Subject: Re: note 11223 added to str_replace
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-10942@lists.php.net to get a copy of this message
A long time ago (at Uni of Qld in the mid 1980s) I read you could get a ' into a string by using ''. This only came up because I was getting no insert when there was a ' in the string e.g. 18' doughboy pool. Obviously there is another way - use \' - which works as good or better. I'll use that from now on. Sorry to hear that server is so slow. > I re-read your original email again. What was the idea > behind doing the single quote -> 2 single quotes > replacement? To insert a single quote into MySQL, it > has to be escaped w/ a backslash not w/ another quote. > The function addslashes() would do that (and some > more).

« previous php.notes (#10942) next »