Hi again,
I am creating a site that uses 2 databases (the secondary db "belongs to" another fuel installation on the same server). I've configured this OK, and one controller in particular uses models that retrieve data from the secondary database. That's working OK too.
What's a bit odd is that the views for this controller have a fuel_nav() in one of the view "blocks", and that returns the navigation for the other installation (that is, from the secondary db). So only models loaded in the controller have an alternate dsn (ultimately), but fuel_nav() is also picking this up somehow. Is there anything I can do to force it to use the intended database?
Comments
$this->load->database($dsn, TRUE, TRUE);
Where $dsn is your database connection array information (also found in the database.php config file).
Incidentally, I extended the models that use the 2nd db from MY_Model, and set the $dsn value inside the extended model's constructor - is that best practice?
Thanks!