multiple database connection problem

#1
[eluser]arslan ali[/eluser]
i have two database connections. But when i query to database it looks for database in last opened connection

Code:
$live = $this->load->database('live_podference', TRUE);
$local = $this->load->database('local_podference', TRUE);

$live->select('*');
$obj_query_result  = $live->get('users',2);
$obj_results = $obj_query_result->result();

$live should search for users table in live_podference, however it searches for users table in local_podference. Which is weired.

My database settings are as follow

Code:
$active_group = "local_podference";

$db['local_podference']['hostname'] = "arslan-ali";
$db['local_podference']['username'] = "root";
$db['local_podference']['password'] = "";
$db['local_podference']['database'] = "podference";
$db['local_podference']['dbdriver'] = "mysql";
$db['local_podference']['dbprefix'] = "pod_";
$db['local_podference']['active_r'] = TRUE;
$db['local_podference']['pconnect'] = TRUE;
$db['local_podference']['db_debug'] = TRUE;
$db['local_podference']['cache_on'] = FALSE;
$db['local_podference']['cachedir'] = "";


$active_group = "live_podference";

$db['live_podference']['hostname'] = "arslan-ali";
$db['live_podference']['username'] = "root";
$db['live_podference']['password'] = "";
$db['live_podference']['database'] = "testexport";
$db['live_podference']['dbdriver'] = "mysql";
$db['live_podference']['dbprefix'] = "";
$db['live_podference']['active_r'] = TRUE;
$db['live_podference']['pconnect'] = TRUE;
$db['live_podference']['db_debug'] = TRUE;
$db['live_podference']['cache_on'] = FALSE;
$db['live_podference']['cachedir'] = "";

any idea about this behaviour of code igniter ?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.