Re: note 11223 added to str_replace
| From: | Jesus M. Castagnetto | Date: | Tue, 13 Feb 2001 04:26:55 +0000 |
| Subject: | Re: note 11223 added to str_replace | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-10973@lists.php.net to get a copy of this message | ||
SQL escaping is (usually) implementation dependent,
but most of them use the \' style (some call this
Unix-style-escaping). Usually it is better to check
the database documentation to be sure.
The only one I know that still uses the double single
quote is Informix.
--- Dwight Walker <dwight@wwwalker.com.au> wrote:
> 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).
>
>
=====
--- Jesus M. Castagnetto <jmcastagnetto@php.net>
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/