Hello, I'm in the midst of creating an admin backend panel for my new website, but I've come across a road-bump.. I have a table in my database with all the users, and one of the fields is 'rank' with as value either admin, user, or moderator. When logging in, I would like to pull the user's rank, and storing it into the session that gets created. When using activerecords, I've only managed to pass the ARRAY through to the session. Although the only thing in the array is the rank of the user, I'd like to pass the actual RANK of the user into the session. Any help would be greatly appreciated! Thanks in advance, Alex
The above post is awesome. Just FYI. So for what you would like: This would be some example model code: public function get_user($username) { $this->db->select('*'); $this->db->from('users'); $this->db->where('username', $username); $this->db->limit(1); $result = $this->db->get(); return $result->row(); } PHP: This would be controller code, after including your model to it (or writing this in a library) $user = $this->modelname->get_user('ze0x'); $this->session->set_userdata('rank', $user->rank); PHP: I hope I explained how to do this well enough. Feel free to add me on MSN if you'd like additional help. I've been working with Codeigniter for two years now. MSN: