Post by doctorAnyone has successfully using CodeIgniter with Informix ?
Hi, I got it working in CodeIgniter 3, below is my setup in database.php;
$db['myexport'] = array(
'dsn' => '',
'subdriver' => 'informix',
'hostname' => getenv('MYEXPORT_HOSTNAME'),
'port' => getenv('MYEXPORT_PORT'),
'username' => getenv('MYEXPORT_USERNAME'),
'password' => getenv('MYEXPORT_PASSWORD'),
'database' => getenv('MYEXPORT_DATABASE'),
'server' => getenv('MYEXPORT_SERVER'),
'dbdriver' => 'pdo',
'db_debug' => TRUE,
'pconnect' => FALSE,
'cache_on' => FALSE
);
and below is the code sample in model/controller;
$this->ifx = $this->load->database('myexport', TRUE);
$sql = 'SELECT cmpy_id FROM company';
$query = $this->ifx->query($sql);
return $query->result_array();