I am getting Notice: Undefined property: stdClass::$id in the lines $uid = $data->id; and $uname = $data->username; of the following function:
public function userlogin()
{
    $sql = 'select id, username from login_user where email="'.$this->email.'"and password="'.$this->password.'"';
    $result = mysqli_query($this->cn,$sql);
    $numrows = mysqli_num_rows($result);
    if($numrows == 1)
    {
        $data = mysqli_fetch_field($result);
        $uid = $data->id;
        $uname = $data->username;
        $_SESSION['login'] = 1;
        $_SESSION['uid'] = $uid;
        $_SESSION['uname'] = $uname;
        $_SESSION['login_msg'] = 'Login Successfully...';
    }
}
 
     
    