Re: DB slashing?
| From: | Chuck Hagenbuch | Date: | Tue, 09 Jan 2001 22:56:51 +0000 |
| Subject: | Re: DB slashing? | ||
| Groups: | php.pear | ||
| Request: | Send a blank email to php-pear+get-919@lists.php.net to get a copy of this message | ||
Quoting Kendrick Vargas <ken@hudat.com>:
> 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?
The quoteString() function is defined in DB/common.php. Every database class
extends DB_common, and thus gains all of its methods. However, any database can
override those methods, so databases that need different behavior just need to
define their own quoteString() function - as DB/oci8.php does. There's no need
to put it in every backend.
-chuck
--
Charles Hagenbuch, <chuck@horde.org>
"If you can't stand the heat, get out of the chicken!" - Baby Blues