Welcome Guest, Not a member yet? Register   Sign In
Calling $this->load->database() multiple times
#11

[eluser]mrbinky3000[/eluser]
This is the best solution to the problem. There is a bug in CI. 1 line of code fixes it so you can do stuff like...

$a = $this->load->database('default', TRUE);
$b = $this->load->database('default', TRUE);

...without the second call to load->database overwriting the first.

Here is the bugfix:
http://koorb.wordpress.com/2007/11/16/co...comment-40

Or if you don't want to go there...

#####start bugfix#####

Description

all of the database calls go to the same database (last one initialized)

To fix the probleme change the simple_query function in DB_driver.php:

function simple_query($sql)
{
if ( ! $this->conn_id)
{
$this->initialize();
}
$this->db_select(); //Added this line
return $this->_execute($sql);
}

#####end bugfix#####
#12

[eluser]WanWizard[/eluser]
<deleted>

note to self: read the rest of the thread before replying...




Theme © iAndrew 2016 - Forum software by © MyBB