Thanks. How stupid of me. What I am really trying to do is add a few more fields into the table.
$insert = array($this->url_field => $file_name);
array_push($insert,'email => ' . $this->session->userdata('userid')); <<trying to add two more fields before doing the insert
array_push($insert,'campaign =>' . $this->session->userdata('campaign'));
$this->ci->db->insert($this->table_name, $insert);
This is failing with "call to a member function userdata() on null". So it seems that my image_CRUD.php module (which is in libraries) cannot load the session data. I tried adding
$this->load->library('session'); to the Constructor in image_CRUD.php but that fails. Since session is related to cookies, I figure that won't work either. I tried a call (within image_CRUD.php) to $campaign= $this->session->userdata('campaign'); but this returns an error "Call to a member function userdata() on null". Any idea how to fix this?
The problem is that I need to get those two variables, email and campaign into two columns in the database record and can't seem to get them transferred to a different module. Any idea how to do this?
also, where did the docs for CI 3 go??
proof that an old dog can learn new tricks