If you are using result()
then it returns the object not an array
if there is a single row returned then you can do it like this
if($query = $this->profile_model->getAllUserInfo()){
if($query[0]->userID == $this->session->userdata('id')){
//do something
}
}
else you have to loop through the $query
to check the user id in the returned result set
if($query = $this->profile_model->getAllUserInfo()){
foreach($query as $q){
if($q->userID == $this->session->userdata('id')){
//do something
}
}// end foreach
}
Here the is CI AR select reference