CodeIgniter Forums
Call to a member function getFirstRow() on bool - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Call to a member function getFirstRow() on bool (/showthread.php?tid=83469)



Call to a member function getFirstRow() on bool - codebelize - 09-28-2022

Hello Everyone, new to CodeIgniter and this forum in general.
I'm trying to find a way to send logged user data back to my homepage view but keep running into this error and I don't know why. 
PHP Code:
public function index() //this is my homepage view controller
    {
        $userModel = new \App\Models\UsersModel(); //Creates new user model object
        $loggedUserID session()->get('loggedUser'); //this gets the user id for the logged in user, which was set when logging in
        $userInfo $userModel->find($loggedUserID); //this is SUPPOSED to find the ID in the user table of my database 
        $data = [
            'title' => 'Dashboard',
            'userInfo' => $userInfo
        
];
      echo view('NCRMN Templates/Header');
      echo view('NCRMN Templates/NCRMN_nav_bar');
      echo view('NCRMN Views/NCRMN',$data); 
      echo view('NCRMN Templates/Footer');
    

The error says "caCall to a member function getFirstRow() on bool"
I'm assuming this means that it can't find the id in the user table, but why would that be?  can confirm that it's in there 

    }