[eluser]c_h_r_i_s[/eluser]
function connect(){
$config = ..
$config['dbdriver'] = "mysql";
$config['dbprefix'] = "";
$config['pconnect'] = TRUE;
$config['db_debug'] = FALSE;
$config['cache_on'] = TRUE;
$config['cachedir'] = "";
$config['char_set'] = "utf8";
$config['dbcollat'] = "utf8_general_ci";
$DB = $this->load->database($config, TRUE);
return $DB;
}
function func2(){
$DB = $this->connect();
$DB->get(‘table’); doesn’t work
}
I have the connect in its own function because there are multiple functions that need to make queries to the 2nd database.
using:
$DB->set('test','test');
$DB->insert('test');
works fine, but when using $DB->get('test'); causes the site to not load the page and you have to hit the back button to continue on to the site. Nothing after the get line is executed so it's hard to debug and turning db_debug to true doesn't provide anything in this case.