I have connected two databases in the config file. I plan to load them in the construct method so that they can be used by other methods. but it's failed and the databases still cannot be used by other methods. it will got the non-object error. I am sure that there is no issue in the databases connection. Because they are normal when load them in each method. Could you please help resolve this issue? Thanks in advance!
The code as below:

The code as below:
PHP Code:
class M_db_sync extends CI_Model {
function __construct(){
parent::__construct();
$db_local = $this->load->database('default', TRUE);
$db_remote = $this->load->database('remote', TRUE);
}
function get_local_data(){
// $db_local = $this->load->database('default', TRUE);
$db_local->order_by("id", "desc");
$db_local->limit(5);
$query = $db_local->get('test');
return $query;
}
function get_remote_data(){
//$db_remote = $this->load->database('remote', TRUE);
$db_remote->limit(10);
$query = $db_remote->get('Current_Full');
return $query;
}
}