0
是否有解決方法讓我獲取錯誤代碼。 驅動程序返回空字符串$ this-> db-> error()「code」index, ,它也使用pg_query()來執行,這就是爲什麼它不會返回錯誤代碼。Codeigniter 3 Postgresql驅動程序錯誤代碼
是否有解決方法讓我獲取錯誤代碼。 驅動程序返回空字符串$ this-> db-> error()「code」index, ,它也使用pg_query()來執行,這就是爲什麼它不會返回錯誤代碼。Codeigniter 3 Postgresql驅動程序錯誤代碼
首先你必須安裝跟隨着包:PHP5-pgsql的
sudo apt-get install php5-pgsql
然後重新啓動Apache:
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start
現在,你設置笨3的文件database.php中
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'tu_usuario',
'password' => 'tu_clave',
'database' => 'tu_base_de_datos',
'dbdriver' => 'postgre',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE,
'port' => 5432,
);
推特:@ luiscordero29
我不能說的代碼,但由於原來的帖子是英文,我會認爲你的迴應也應該爲後代。 – wahwahwah
我找到了解決方法,並使用PDO驅動程序,而不是 –