codeigniter / ci / oracle database.php 的設定方式 / utf8 / big5 粉難搞

$db[‘oci’][‘hostname’] = “//IP_ADDRESS/INSTANT_NAME”; $db[‘oci’][‘username’] = “USERNAME”; $db[‘oci’][‘password’] = “PASSWORD”; $db[‘oci’][‘database’] = “INSTANT_NAME”; $db[‘oci’][‘dbdriver’] = “oci8”; $db[‘oci’][‘dbprefix’] = “”; $db[‘oci’][‘pconnect’] = TRUE; $db[‘oci’][‘db_debug’] = TRUE; $db[‘oci’][‘cache_on’] = FALSE; $db[‘oci’][‘cachedir’] = “”; $db[‘oci’][‘char_set’] = “utf8”; // database 是 UTF8 $db[‘oci’][‘char_set’] = “ZHT16BIG5”; // database 是 big5 $db[‘oci’][‘dbcollat’] = “utf8_general_ci”; 記得 codeigniter 的 /system/database/drivers/oci8/oci8_driver.php 這個檔要改一下 2009.0303 補充, 若要連 […]

Codeigniter 聯接 Oracle database 要改的地方

Codeigniter version 1.6.3 Oracle version 10.2.0.4 use oci8 遇到這個 error : Message: ocifetchinto() expects parameter 1 to be resource, null given // 這個檔 \system\database\DB_driver.php 改成.. // $RES->num_rows = $RES->num_rows(); if ($this->dbdriver == ‘oci8’) { $RES->stmt_id = $this->stmt_id; $RES->curs_id = NULL; $RES->limit_used = $this->limit_used; } $RES->num_rows = $RES->num_rows(); 解決沒有使用 UTF8 的問題 // 這個檔 \system\database\drivers\oci8\oci8_driver.php // 改兩個地方: […]