Welcome Guest, Not a member yet? Register   Sign In
Call to a member function getFirstRow() on bool
#1

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 

    }
Reply


Messages In This Thread
Call to a member function getFirstRow() on bool - by codebelize - 09-28-2022, 09:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB