database.php:
$db['default']['hostname'] = "192.168.2.104";
$db['default']['username'] = "webuser";
$db['default']['password'] = "----";
$db['default']['database'] = "vad";
$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['stats']['hostname'] = "192.168.2.104";
$db['stats']['username'] = "webuser";
$db['stats']['password'] = "---";
$db['stats']['database'] = "vad_stats";
$db['stats']['dbdriver'] = "mysql";
$db['stats']['dbprefix'] = "";
$db['stats']['pconnect'] = TRUE;
$db['stats']['db_debug'] = TRUE;
$db['stats']['cache_on'] = FALSE;
$db['stats']['cachedir'] = "";
$db['stats']['char_set'] = "utf8";
$db['stats']['dbcollat'] = "utf8_general_ci";
$db['ss']['hostname'] = "192.168.2.104";
$db['ss']['username'] = "webuser";
$db['ss']['password'] = "---";
$db['ss']['database'] = "vad_stats";
$db['ss']['dbdriver'] = "mysql";
$db['ss']['dbprefix'] = "";
$db['ss']['pconnect'] = TRUE;
$db['ss']['db_debug'] = TRUE;
$db['ss']['cache_on'] = FALSE;
$db['ss']['cachedir'] = "";
$db['ss']['char_set'] = "utf8";
$db['ss']['dbcollat'] = "utf8_general_ci";
$DB2 = $this->load->database('stats', TRUE);
$database1 = $this->load->database('database1', TRUE);
$database2 = $this->load->database('database2', TRUE);
$db_call = $this->load->database('ss', TRUE);
$q = "SELECT * FROM $table";
$qryObj = $db_call->query($q);
$qryBag = $qryObj->result_array();
0 Response to "koneksi dua or multiple database codeigniter"
Posting Komentar