note 11774 added to AddSlashes
| From: | spamdunk at home dot com | Date: | Tue, 06 Mar 2001 18:12:22 +0000 |
| Subject: | note 11774 added to AddSlashes | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11941@lists.php.net to get a copy of this message | ||
FYI, Quoting the single quote (') as ('') is not an Oracle stle, or a Sybase style,
or any other vendor-specific style. It is the ANSI SQL (i.e. SQL standard) style.
Using blackslahes to escape characters is a proprietary extension that some databases have. If you
want your SQL to be portable across databases, don't use it.
For example (on PostgreSQL):
=> create table t (s varchar(64));
CREATE
=> insert into t values ('one''two"three''');
INSERT 206474 1
wapkey=> select * from t;
s
----------------
one'two"three'
(1 row)
... as expected, as per the standard.
http://www.php.net/manual/en/function.addslashes.php