Anyone has successfully using CodeIgniter with Informix ?
On Saturday, August 6, 2011 at 9:24:19 PM UTC+8, doctor wrote:
Anyone 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();
And make sure you have PDO and pdo_informix module installed in PHP.could not find driver
On Tuesday, March 22, 2016 at 11:05:02 AM UTC+8, sula...@terato.com wrote:
On Saturday, August 6, 2011 at 9:24:19 PM UTC+8, doctor wrote:
Anyone 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();
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 78:26:40 |
Calls: | 6,658 |
Calls today: | 4 |
Files: | 12,203 |
Messages: | 5,332,975 |
Posted today: | 1 |