I am trying to login in my website, I am using CodeIgniter framework in the models folder I created User\_model.php and function called authenticate user and that is the code:

```
public function authenticate_user($us, $pass){
    $query = $this->db->query("SELECT username, password FROM users WHERE username = '".$us."' AND  password = '".$pass."' LIMIT 1");
    return $query->row();
}

```

in the controller folder I created a user.php with function called login
and that is part of the code:

```
public function login(){

    if($_POST){
        $result = $this->user_model->authenticate_user($_POST['username'],$_POST['password']);

        // If the username and password found
        if(!empty($result)){
            // Set userdata
            $userdata = [       
                                    'id' => $result->id,
                'username' => $result->username,
                'password' => $result->password,
                'logged_in' => TRUE
            ];

```

the error is in the line which contains 'id' => $result->id I don't know why it was working fine with no errors and I didn't change anything and suddenly it gives me that error 

The database contains a table called users with 3 attributes id and it is auto incremented, username and password that's it, by the way the website is on a free host and giving me this error when ever I try to login.

Any help please just to understand why I am getting this error.

[![error message](https://i.stack.imgur.com/QKsul.png)](https://i.stack.imgur.com/QKsul.png)