I need to connect to another mysql database I am doing following
$dsn = "{$dbdriver}://$vars[username]:$vars[password]@$vars[hostname]/$vars[database]";
$db2 = $this->EE->load->database($dsn, true);
$res = $db2->from('categories')->get()->result_array();
But I get error message Fatal error: Call to a member function result_array() on a non-object
That is third party script so db connection already made early. Then that script should connect to another db but 1st db connection already created
$dsn contains correct data. Why I get this error?
Thanks
I have figured it out. The query should contains additional param
db_debug=1so the dsn string should look like