$this->db->set('campaign', $campaign); //set the last campaign used
I am autoloading database.php and all is OK. I have another module that is being spawned by koolreports render() command. In it I have no access to $this. So when I try to access the db from it $this->db fails. I was having the same issue with sessions. Someone up here recommended using:
$CI = & get_instance();
$CI->load->model('MyModel')->library('session');
$this->MyModel = $CI->MyModel;
$this->session = $CI->session;
which worked great.
Any idea how i can get analagous access to the db (which is already open) in another module?
I am autoloading database.php and all is OK. I have another module that is being spawned by koolreports render() command. In it I have no access to $this. So when I try to access the db from it $this->db fails. I was having the same issue with sessions. Someone up here recommended using:
$CI = & get_instance();
$CI->load->model('MyModel')->library('session');
$this->MyModel = $CI->MyModel;
$this->session = $CI->session;
which worked great.
Any idea how i can get analagous access to the db (which is already open) in another module?
proof that an old dog can learn new tricks