Welcome Guest, Not a member yet? Register   Sign In
Multiple DB connection - System get the wrong one
#15

[eluser]Justin Patel[/eluser]
i also had the same problem,

but I have some temporary solutions

take a look sample below


for this do not put database library in to auto load

Code:
// FIRST DATABASE Connection  { Temporary }
    
//----------------------------------------------------------------


$dbh=mysql_pconnect ("localhost", "costa04_affiliat", "XXXXX") or die ('I cannot connect to the database because: ' . mysql_error());
            
$dbname = 'costa04_affiliate';
mysql_select_db($dbname);
$sg = mysql_query("select * from test")or die(mysql_error());
while($row = mysql_fetch_array($sg))
        echo $row['name']."<br>";
             mysql_close();


// do your work with first database

//-------------------------------------------------------------------
        
// the function need the another database connection do below code


//------------------------------------------------------------------

//-------- This is the database define in the config/database.php

            $shreeGanesh = $this->load->database();
            $this->load->model('servers_model');
            $this->load->model('proxy_model');

//------------------------------------------------------------------


I have used the both in the single function and its working great


take a try Smile


Messages In This Thread
Multiple DB connection - System get the wrong one - by El Forum - 10-29-2007, 04:01 AM
Multiple DB connection - System get the wrong one - by El Forum - 10-30-2007, 12:44 PM
Multiple DB connection - System get the wrong one - by El Forum - 10-30-2007, 12:52 PM
Multiple DB connection - System get the wrong one - by El Forum - 10-30-2007, 07:12 PM
Multiple DB connection - System get the wrong one - by El Forum - 10-30-2007, 10:45 PM
Multiple DB connection - System get the wrong one - by El Forum - 10-31-2007, 12:51 AM
Multiple DB connection - System get the wrong one - by El Forum - 10-31-2007, 01:10 AM
Multiple DB connection - System get the wrong one - by El Forum - 10-31-2007, 02:08 AM
Multiple DB connection - System get the wrong one - by El Forum - 10-31-2007, 02:12 AM
Multiple DB connection - System get the wrong one - by El Forum - 10-31-2007, 03:27 AM
Multiple DB connection - System get the wrong one - by El Forum - 10-31-2007, 03:39 AM
Multiple DB connection - System get the wrong one - by El Forum - 10-31-2007, 05:55 AM
Multiple DB connection - System get the wrong one - by El Forum - 10-31-2007, 06:14 AM
Multiple DB connection - System get the wrong one - by El Forum - 10-31-2007, 07:19 PM
Multiple DB connection - System get the wrong one - by El Forum - 11-02-2007, 04:16 AM
Multiple DB connection - System get the wrong one - by El Forum - 11-02-2007, 04:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB