Multiple databases connection problem

#1
[eluser]jahbob[/eluser]
Hi I will try to describe my problem here:

I was running a script locally that handled 3 connections to mysql running at same time with 3 different hosts


Now Im running same script but on one of hosts so I still have 3 connections but 2 of them are from same host, but they are from different databases on same host

The problem is that one of the connections dosnt select the right database, it just selects the last database used for that host .

My configs are :

$config['hostname'] = "host1";
$config['username'] = "x";
$config['password'] = "x";
$config['database'] = "database";
$config['dbdriver'] = "mysql";
$config['dbprefix'] = "";
$config['pconnect'] = TRUE;
$config['db_debug'] = TRUE;
$config['cache_on'] = FALSE;
$config['cachedir'] = "";
$config['char_set'] = "utf8";
$config['dbcollat'] = "utf8_general_ci";

$this->conn1= $this->load->database($config,TRUE);



$config2['hostname'] = "host2";
$config2['username'] = "user";
$config2['password'] = "x";
$config2['database'] = "database2";
$config2['dbdriver'] = "mysql";
$config2['dbprefix'] = "";
$config2['pconnect'] = TRUE;
$config2['db_debug'] = TRUE;
$config2['cache_on'] = FALSE;
$config2['cachedir'] = "";
$config2['char_set'] = "utf8";
$config2['dbcollat'] = "utf8_general_ci";

$this->conn2= $this->load->database($config2,TRUE)


$config['hostname'] = "host2";
$config['username'] = "user";
$config['password'] = "x";
$config['database'] = "database3";
$config['dbdriver'] = "mysql";
$config['dbprefix'] = "";
$config['pconnect'] = TRUE;
$config['db_debug'] = TRUE;
$config['cache_on'] = FALSE;
$config['cachedir'] = "";
$config['char_set'] = "utf8";
$config['dbcollat'] = "utf8_general_ci";

$this->conn3= $this->load->database($config,TRUE);



The conn2 end up using database3 instead of database2 when I try to query something

So Iam doing something wrong ?


Messages In This Thread
Multiple databases connection problem - by El Forum - 06-28-2013, 07:26 PM
Multiple databases connection problem - by El Forum - 06-30-2013, 01:37 PM
Multiple databases connection problem - by El Forum - 07-01-2013, 09:47 AM
Multiple databases connection problem - by El Forum - 07-01-2013, 01:41 PM
Multiple databases connection problem - by El Forum - 07-02-2013, 01:32 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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