Welcome Guest, Not a member yet? Register   Sign In
Multiple database connection problem
#2

[eluser]xwero[/eluser]
To connect to multiple instances you have to set the second argument of the load to true and you have to rename the object

Code:
oreach ($xml->databaseGroup as $studioList)
{
$config = null;
$config[’name’] = $studioList->Name;
$config[’hostname’] = $studioList->configuration->Server;
$config[’username’] = $studioList->configuration->DBUser;
$config[’password’] = $studioList->configuration->DBUser;
$config[’database’] = $studioList->configuration->DBPassword;
$config[’dbdriver’] = “mysql”;
$config[’dbprefix’] = “”;
$config[’pconnect’] = FALSE;
$config[’db_debug’] = TRUE;
$config[’active_r’] = TRUE;
$DB{i} = $this->load->database($config,true); // changed line
echo $i++;
}

instead of $this->db->query() you have to use $DB1->query().


Messages In This Thread
Multiple database connection problem - by El Forum - 10-11-2007, 07:53 AM
Multiple database connection problem - by El Forum - 10-11-2007, 11:48 AM
Multiple database connection problem - by El Forum - 10-12-2007, 03:40 AM
Multiple database connection problem - by El Forum - 10-12-2007, 03:59 AM
Multiple database connection problem - by El Forum - 10-12-2007, 09:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB