Re: DB slashing?
| From: | Kendrick Vargas | Date: | Tue, 09 Jan 2001 22:33:40 +0000 |
| Subject: | Re: DB slashing? | ||
| References: | 1 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-917@lists.php.net to get a copy of this message | ||
On Tue, 9 Jan 2001, Chuck Hagenbuch wrote:
> Quoting Kendrick Vargas <ken@hudat.com>:
>
> > I just downloaded the latest php to get a relatively recent version of
> > PEAR, and I was wondering... Is there a plan to put any functions in the
> > database specific include (DB/mysql.php for ex.) to escape strings
> > properly with slashes? I know that there's a mysql_escape_strings function
> > (though it doesn't show in the manual) and I don't know if the other
> > databases have dedicated escaping functions.
>
> DB::quoteString().
Yes, but this just does a generic escaping of ' to \' ... Unless I'm
reading it wrong, mysql_escape_string escapes more than DB::quoteString()
does.
Do other databases require different escaping of strings? I've heard
"yes", but then again, I may be wrong. Just looking at the annotated
manual page shows different escaping for sybase, etc... Wouldn't it be a
good idea to have the quoteString function use the database specific
function when it's available?
I imagine this would require moving the quoteString function into each
database file and modifying as necessary whenever necessary. Is this such
a bad thing?
-peace
--- BEGIN GEEK CODE BLOCK ----------+----------
GAT d- s:+ !a C++$ UL/S/I/B++++$ P+ | "In the ongoing battle between objects
L++ E- W+(+++) N K- w(---) O-- M@ | made of aluminum going hundreds of
V(--) PS+++ PE Y+ PGP@ t++ 5 X+ R- | miles per hour and the ground going
tv+ b- DI++++ D+(+++) G e>++ h--- | zero, the ground has yet to lose."
r++ z+>+++ - END GEEK CODE BLOCK ---+