0
我有這樣的代碼笨連接數據庫自定義錯誤
$specific['hostname'] = "localhost";
$specific['username'] = "root";
$specific['password'] = "";
$specific['database'] = "ci_forsyria";
$specific['dbdriver'] = "mysql";
$specific['dbprefix'] = "";
$specific['pconnect'] = FALSE;
$specific['db_debug'] = FALSE;
$specific['cache_on'] = FALSE;
$specific['cachedir'] = "";
$specific['char_set'] = "utf8";
$specific['dbcollat'] = "utf8_general_ci";
$specific_db = $this->load->database($specific, TRUE);
我用這個參數「FALSE」可以隱藏連接錯誤!
$specific['db_debug'] = FALSE;
但如果連接字段
像
$連接我可以如何創建自定義錯誤消息= $這個 - > DB->連接; 如果(!$連接) {// 打印錯誤消息.. }
可能重複http://stackoverflow.com/questions/10167835/codeigniter-autoload-db-but-have-ability檢查是否連接存在 – 2012-04-16 07:31:17
我必須停止錯誤,因爲我想我的頁面加載都在 – 2012-04-16 07:39:39
$ specific ['db_debug'] = FALSE; – 2012-04-16 07:41:26