$this->user->Data('firstname') should be $this->user->Data('id') and database changed accordingly.