Re: DataObjects Errors and Quoting
| From: | Justin Patrin | Date: | Fri, 19 Aug 2005 16:52:55 +0000 |
| Subject: | Re: DataObjects Errors and Quoting | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-20485@lists.php.net to get a copy of this message | ||
On 8/18/05, Jeff Loiselle <jeff@newnewmedia.com> wrote:
> I've been reading the docs but I feel I am missing something. If
> DataObjects performs a bad query, how can I get the bad query so I can
> log it? Also, it doesn't seem to escape input data for the database..
> how do I perform a DB::quote() on the values for the query? Why doesn't
> it do this automatically like PEAR:DB :-(
>
DB_DataObject should always quote your data correctly. In fact it can
also quote table and column names if you set quote_identifiers in your
ini file.
You should be able to get the last error from the _lastError property
of you DataObject or from
PEAR::getStaticProperty('DB_DataObject','lastError'); You can view SQL
and debug messages with DB_DataObject::debugLevel(1);
If data is, indeed, not getting quoted properly, it could be a bug in
DB or DB_DataObject but I doubt it. Please try using the debug output
to find an improper query and then show us the code which creates this
query. Also, please let us know what database backend you're using
(mysql, etc).
--
Justin Patrin