How to get data objects in controller |
I still can't get it working, I'll try and break the code down into it's simplest parts:
In my model: // will include the password later public function jobseekersLogin($email, $password) { $this->db->select('*'); $this->db->from('jobseekers'); $this->db->where('lc_email', $email); $this->db->limit(1); $query = $this->db->get(); if ($query->num_rows() == 1) { return $query->result_array(); } else { return false; } } in my controller: // This is returning a large array as tested with print_r $data['user'] = $this->jobseekers_model->jobseekersLogin($jbsEmail, $jbsPassword); 107: $userId = $data['userData']['lc_id']; A PHP Error was encountered Severity: Notice Message: Undefined index: lc_id Filename: controllers/Jobseekers.php Line Number: 107 Backtrace: lc_id is the primary id column in the database, I would have thought with this code all columns would now be available i.e $userId = $data['userData']['email]; $userId = $data['userData']['first_name']; etc etc? |
Messages In This Thread |
How to get data objects in controller - by barrypoore - 04-09-2018, 05:04 AM
RE: How to get data objects in controller - by jreklund - 04-09-2018, 05:40 AM
RE: How to get data objects in controller - by barrypoore - 04-09-2018, 05:46 AM
RE: How to get data objects in controller - by jreklund - 04-09-2018, 06:47 AM
RE: How to get data objects in controller - by barrypoore - 04-09-2018, 09:08 AM
RE: How to get data objects in controller - by barrypoore - 04-09-2018, 10:01 AM
RE: How to get data objects in controller - by jreklund - 04-09-2018, 10:25 AM
RE: How to get data objects in controller - by barrypoore - 04-09-2018, 11:32 AM
|