![]() |
[Session] ID of account from accounts table - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: [Session] ID of account from accounts table (/showthread.php?tid=858) |
[Session] ID of account from accounts table - qeenyu - 01-23-2015 Hello, I'm trying to get 'id' value from 'accounts' table and insert it into 'user data' column at 'ci_sessions' table. The thing is it's not working. I have tried using: $this->session->set_userdata('id', $id); but in 'user_data' field I have inserted "id";N; How to set id of account logged in? This is my validate function in login controller: PHP Code: public function validate_credentials() PHP Code: class Membership_model extends CI_Model Hope, someone will help me, or give me some tip, what should I do. Thanks in advance, greetings qeenyu RE: [Session] ID of account from accounts table - Smith - 01-24-2015 Hi, please make these changes. you have several errors in the code. Before using codeigniter you should learn to program in php membership_model: PHP Code: function validate($name, $pass) controller: PHP Code: $name = $this->input->post('name', TRUE); RE: [Session] ID of account from accounts table - qeenyu - 01-24-2015 Thank you for help. I didn't realize that this code can be messed. I got it from yT tutorial, anyways, thank you. Rep++ |