[eluser]gcanizal[/eluser]
I still have the same problem. If I activate database db2 in file "database.php":
Code:
$active_group = "db2";
On the one hand, I call the next controller and I have a database error:
Code:
class TestDB extends My_Controller
{
private $db1;
function TestDB()
{
parent::My_Controller();
}
function index()
{
$response = $this->A();
$response = $this->B();
}
public function A (){
$this->db1 = $this->load->database('db1',TRUE);
$result_set = $this->db1->query("SELECT * FROM TABLE1");
}
public function B (){
$this->db->query("SELECT * FROM TABLE2");
}
}
It returns:
A Database Error Occurred
Error Number:
SELECT * SELECT * FROM TABLE2
But if I call the functions in the other order (first I call B and then A), everything goes fine.
Is there any problem with "
mssql driver"? We lose the default data base connection.
On the other hand, in the case I reconnect before all querys it works fine:
Code:
class TestDB extends My_Controller
{
private $db1;
function TestDB()
{
parent::My_Controller();
}
function index()
{
$response = $this->A();
$response = $this->B();
}
public function A (){
$this->db1 = $this->load->database('db1',TRUE);
$result_set = $this->db1->query("SELECT * FROM TABLE1");
}
public function B (){
$db2 = $this->load->database('db2',TRUE);
$db2->query("SELECT * FROM TABLE2");
}
}
And finally my problem:
What happens with the
sessions when they are stored in a table if we lose the default connection?
Thank you