Error handling Codeigniter 3 Postgresql驱动程序错误代码
是否有一个解决方法让我获得错误代码。 驱动程序返回$this->db->error()“code”索引的空字符串,Error handling Codeigniter 3 Postgresql驱动程序错误代码,error-handling,postgresql-9.3,codeigniter-3,Error Handling,Postgresql 9.3,Codeigniter 3,是否有一个解决方法让我获得错误代码。 驱动程序返回$this->db->error()“code”索引的空字符串, 它还使用pg_query()执行,这就是它不会返回错误代码的原因。首先必须安装以下软件包:php5 pgsql sudo apt-get install php5-pgsql 然后重新启动apache: sudo /etc/init.d/apache2 stop sudo /etc/init.d/apache2 start 现在,您设置了codeigniter 3的data
它还使用pg_query()执行,这就是它不会返回错误代码的原因。首先必须安装以下软件包:php5 pgsql
sudo apt-get install php5-pgsql
然后重新启动apache:
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start
现在,您设置了codeigniter 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,
);
Twitter:@luiscordero29我找到了一个解决方法,并使用PDO驱动程序,但由于最初的帖子是用英语写的,我想你的回复也应该是为子孙后代写的。