Welcome Guest, Not a member yet? Register   Sign In
db not appearing in module.
#1

(This post was last modified: 01-20-2021, 05:58 AM by richb201.)

$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? 
proof that an old dog can learn new tricks
Reply


Messages In This Thread
db not appearing in module. - by richb201 - 01-19-2021, 02:36 PM
RE: db not appearing in module. - by InsiteFX - 01-20-2021, 04:03 AM
RE: db not appearing in module. - by richb201 - 01-20-2021, 06:01 AM
RE: db not appearing in module. - by iRedds - 01-21-2021, 11:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB