// set the default action to take on error
pear::seterrorhandling(pear_error_die);
// from here you don't need to check errors any more
$db = db::connect('pgsql://postgres@localhost/my_database');
$res = $db->query('select id from no_table');
// at this point the execution is aborted and the error message is raisen
...
?>
高级示例:
|