reading session userdata problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: reading session userdata problem (/showthread.php?tid=53111) |
reading session userdata problem - El Forum - 07-11-2012 [eluser]illuzionist[/eluser] Hello, I'm new to codeigniter and php in general so I've got a question. I'm trying to save some userdata to the session just like this: Code: $data = array( username gets saved ok and I can echo it out just like this in some other view: Code: echo $this->session->userdata('username'); but when I try to echo out firstname, lastname, admin or id I get this error: Quote:A PHP Error was encountered is it maybe the problem how I get those variables from database? firstname, lastname, admin and id are all located in my database, and I get it just like this: Code: $first_name = $this->db->query('SELECT firstname FROM users WHERE username = ?', $this->input->post('username')); |