Re: [PHP-PEAR] troubles with db classes
[email protected] ((Stig Sæther Bakken)) 12 Mar 2001 18:45:51 +0100
| Newsgroups | php.pear |
|---|---|
| Message-ID | <[email protected]> |
[Burak DAYIOGLU <[email protected]>] > Hello, > I found out the problem at last. The query() method is not implemented > in the pgsql.php file. So when I call the query method, it is called > but as no implementation is provided nothing happens (and no error or > warning is displayed as well). When I try to get count of rows returned > I get the real error... None of the DB_<dbtype> classes have the query() method, it's inherited from DB_common. All the database-specific stuff is in simpleQuery(), query() is merely a wrapper returning a DB_result object. > Wouldn't it be better to give a descriptive error message when numrows() > is called for a handle which is not valid or not full with some data? > Stig? PEAR has an error system that is pretty configurable and that is not "noisy" by default (printing errors) like PHP is. You can configure it to, though. Try this: $dbh = DB::connect($dsn); $dbh->setErrorHandling(PEAR_ERROR_DIE); If you only want to print the error message, use PEAR_ERROR_PRINT instead, or PEAR_ERROR_TRIGGER if you want to use PHP's internal errors. - Stig -- Stig Sæther Bakken <[email protected]> Fast Search & Transfer ASA, Trondheim, Norway