Re: DataObject an DB Exeptions

From: Date: Tue, 29 Jun 2004 07:43:20 +0000
Subject: Re: DataObject an DB Exeptions
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-13398@lists.php.net to get a copy of this message
This should be fixed in CVS. find() returns false on error, or 0 on no data from what I remember.. - you then have to grab the error from the $obj->_lastError Regards Alan kundert@mysunrise.ch wrote:
Hi I'v got a big understanding problem with DataObject and Database Exceptions (e.g. Unique Key violation, wrong atribute name and so on). If an exception raise after calling ->find() because of an invalid SQL, no error will occoure, even in debug mode not! The method find() execute the folling statement: $this->_query('SELECT ' .
            $this->_query['data_select'] .
            ' FROM ' . ($quoteIdentifiers ? $DB->quoteIdentifier($this->__table) : $this->__table) . " " .
            $this->_join .
            $this->_query['condition'] . ' '.
            $this->_query['group_by']  . ' '.
            $this->_query['having']    . ' '.
            $this->_query['order_by']  . ' '.
In case of an error, _query() returns an Pear Error object, but it goes to nowhere. No error occoure, it looks like the query doesn't return a row, because there is no data. How can I find out, if there was an SELECT error or the query returns no error?
thanks, Marco
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

« previous php.pear.general (#13398) next »