Welcome Guest, Not a member yet? Register   Sign In
multiple db connection issue
#2

[eluser]Dam1an[/eluser]
It's because you decalre the variable in the constructor in the constructor, so it's only visible there
Try
Code:
class MGalleries extends Model {
    private $db;
    private $check;
    
    public function __construct() {
        parent::Model();
        $this->db = $this->load->database('default', TRUE);
        $this->check = $this->load->database('mine', TRUE);
    }
}

You will now need to use $this->db and $this->check in the other functions to use it


Messages In This Thread
multiple db connection issue - by El Forum - 06-08-2009, 09:21 PM
multiple db connection issue - by El Forum - 06-09-2009, 01:50 AM
multiple db connection issue - by El Forum - 06-09-2009, 06:06 AM
multiple db connection issue - by El Forum - 06-09-2009, 06:11 AM
multiple db connection issue - by El Forum - 06-09-2009, 06:13 AM
multiple db connection issue - by El Forum - 06-09-2009, 07:05 AM
multiple db connection issue - by El Forum - 07-26-2009, 12:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB