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

[eluser]Unknown[/eluser]
I am not able to open the multiple database connection using hooks.Here is the method I am using for this.

function loadDatabaseInfo()
{
// set the XML file name as a PHP string
$databaseConfList = getcwd()."/conf/database.xml" ;
// load the XML file
$xml = @simplexml_load_file($databaseConfList) or die ("no file loaded") ;
// assign the listName element to a string

// $xml->databaseGroup[1]->StudioName = "hello1";
// $filedata = $xml->asXML();
//
// file_put_contents($databaseConfList,$filedata);
$i = 0;
foreach ($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);
echo $i++;
}

return null;


Can anybody please suggest how to get this done.


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