In my controller
I load my model, then execute the function getAllUserInfo()
. Basically that function just does a SELECT
in my DB and returns the result()
Now back to my controller I want to check the ID of the user that the result()
returned to my controller to the ID stored in my session. I'm doing it like so
$this->load->model('profile_model');
if($query = $this->profile_model->getAllUserInfo()){
if($query['userID'] == $this->session->userdata('id')){
//do something
}
But I'm getting this error
Message: Undefined index: userID
I checked this also on stackoverflow in the following topics, but they didn't really help me