Bug #1690 [NEW]: PEAR::DB no catch query() error ? @mysql
| From: | donyad at 126 dot com | Date: | Mon, 21 Jun 2004 09:32:17 +0000 |
| Subject: | Bug #1690 [NEW]: PEAR::DB no catch query() error ? @mysql | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-31012@lists.php.net to get a copy of this message | ||
From: donyad at 126 dot com
Operating system: WinXP
PHP version: 4.3.7
Package: Bug System
Bug Type: Bug
Bug description: PEAR::DB no catch query() error ? @mysql
Description:
------------
when i query a wrong sql at mysql
PEAR::DB do not report me sql error
just PHP report me the next function was undefined ...
the DB class just download today
DB-1[1].6.4.tgz
Reproduce code:
---------------
$dsn = 'mysql://root:root@localhost/my_database';
$options = array(
'debug' => 2,
'portability' => DB_PORTABILITY_ALL,
);
$db = DB::connect($dsn, $options);
if(DB::isError($db)){
die($db->getMessage());
}
$db->setFetchMode(DB_FETCHMODE_ASSOC);
$result = $db->query('select * from my_table where hide=0 order by time
desc');
if(DB::isError($db)){
die($db->getMessage());
}
//my_table do not have time field
//this sql is error
//butPEAR() catch nothing ...
Expected result:
----------------
wish it act as phplib
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=1690&edit=1
--