Reputation: 91
Noob in PHP interbase.
i'm working on a project where i need to save the data in 2 separate databases. i use default MySQL database while another one using firebird. downloaded this library
here's my database.php in config folder.
$active_group = "default";
$active_record = TRUE;
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "";
$db['default']['database'] = "po_pusat";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
$db['sdisdb']['hostname'] = "myIp";
$db['sdisdb']['username'] = "sysdba";
$db['sdisdb']['password'] = "masterkey";
$db['sdisdb']['database'] = "D:\path\to\database.fdb";
$db['sdisdb']['dbdriver'] = "firebird";
$db['sdisdb']['dbprefix'] = "";
$db['sdisdb']['pconnect'] = FALSE;
$db['sdisdb']['db_debug'] = TRUE;
$db['sdisdb']['cache_on'] = FALSE;
$db['sdisdb']['cachedir'] = "";
$db['sdisdb']['char_set'] = "utf8";
$db['sdisdb']['dbcollat'] = "utf8_general_ci";
the function that require multiple database
function save()
{
/*.....*/
$order= true;
$this->item_model->create_purchaseorder($data['companyid'],$data['username'],$status,$data['tanggal'],$data['reqdate'],$data['duedate']); $data['purchaseorderid']=$this->item_model->get_purchaseorderid();
$this->item_model->create_purchaseorderdb2($data['companyid'],$data['username'],$status,$data['tanggal'],$data['purchaseorderid'],$data['duedate']);
}
the model
function create_purchaseorderdb2($company,$username,$status,$tanggal,$purchaseorderid,$duedate){
$this->db2=$this->load->database('sdisdb',TRUE);
$data= array(
'SOHEADERID' => '',
'COMPANYID' => $company,
'ECCODE' => 'IDR',
'STATUS' => $status,
'SODATE' => $tanggal,
'WEBSOHEADERID' => $purchaseorderid
);
$this->db2->insert('SOHEADER',$data);
}
i have no problem with the create_purchaseorder function but when i run the "save" function it gives me this error
Fatal error: Call to undefined function ibase_connect()
i already modified the php.ini file ;extension=php_interbase.dll to extension=php_interbase.dll
Upvotes: 3
Views: 966
Reputation: 1522
Make sure you have php_interbase.dll in your PHP install. For reference:
http://www.php.net/manual/en/install.windows.extensions.php
Upvotes: 1