database.php
... $active_group = "default"; $active_record = TRUE; $db['oracle']['hostname'] = '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.1)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = DATUBASIEN_IZENA)))'; $db['oracle']['username'] = "ERABILTZAILEA"; $db['oracle']['password'] = "PASAHITZA"; $db['oracle']['database'] = ""; $db['oracle']['dbdriver'] = "oci8"; $db['oracle']['dbprefix'] = ""; $db['oracle']['pconnect'] = TRUE; $db['oracle']['db_debug'] = TRUE; $db['oracle']['cache_on'] = FALSE; $db['oracle']['cachedir'] = ""; //$db['oracle']['char_set'] = "utf8"; //$db['oracle']['dbcollat'] = "utf8_general_ci"; $db['mysql']['hostname'] = '192.168.1.2'; $db['mysql']['username'] = "ERABILTZAILEA"; $db['mysql']['password'] = "PASAHITZA"; $db['mysql']['database'] = "cmsforms"; $db['mysql']['dbdriver'] = "mysql"; $db['mysql']['dbprefix'] = ""; $db['mysql']['pconnect'] = TRUE; $db['mysql']['db_debug'] = TRUE; $db['mysql']['cache_on'] = FALSE; $db['mysql']['cachedir'] = ""; $db['mysql']['char_set'] = "utf8"; $db['mysql']['dbcollat'] = "utf8_general_ci"; ...
Oin geure programan:
$oracle = $this->load->database('oracle', true); $mysql = $this->load->database('mysql', true); $query = $mysql->query('select * from taula'); $result = $query->result(); echo 'mysql: '; var_dump($result); $query = $oracle->query('select * from taula'); $result = $query->result(); echo 'oracle: '; var_dump($result);