I am getting this error when I call for the function My() for the second time. The first time (when I'm calling for the user\_id) everything seems to be fine.. Stripped down code:

```
class User {
    function My($field) {
        global $user;
        global $db;
        global $sessions;

        if ($sessions == 2) {
            $user = $db->Row("SELECT * FROM users WHERE username='".$_SESSION['username']."'"); 
            return $user->$field;
        }
    }
}

$user = new User;

class Index {
    function Startup() {
        global $user;

        $user_id = $user->My("user_id");
        $name = $user->My("firstname")." ".$user->My("surname");
    }
}

```

Any suggestions would be greatly appreciated.