Pear DB 新手入门指南[37]

[入库:2005年8月19日] [更新:2007年3月24日]

本文简介:选择自 flappy_man 的 blog

// 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
...
?>

 

高级示例:

 
<?php
// define the app environment (this is: what errors you want to output)
define ('debug_env'true);
// this function will handle all errors
function handle_pear_error ($error_obj) {
    
// be verbose while developing the application
    
if (debug_env) {

本文关键:Pear DB 新手入门指南
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top