Session ID |
Hi im a newbbie , i need you help or advise ,
im making some report and i need to use the "id" from PHP Code: $this->session->userdata('logged_in'); i check $ses= $this->session->userdata('logged_in'); echo '<pre>'; print_r($ses); and my data is [id] => 23 [username] =>John Doe now how i can use this id because i do this and dont show anything $ses= $this->session->userdata('id'); echo '<pre>'; print_r($ses); (01-29-2016, 07:26 AM)morocho1979 Wrote: Hi im a newbbie , i need you help or advise , Your id is stored as an element in the $ses array so to access it you can use $ses['id']
(01-29-2016, 07:38 AM)pdthinh Wrote:(01-29-2016, 07:26 AM)morocho1979 Wrote: Hi im a newbbie , i need you help or advise , no i want to use in my model so i try this PHP Code: function obtenerListaClientes() in the controller i add $ses= $this->session->userdata('logged_in'); ofcourse no work i dont have any idea thx for the help
You can use the Session Lib on your model classes. Just load it on your model constructor and then use it the way you do on your controller, but on your model instead.
Got it? ![]()
Best regards,
José Postiga Senior Backend Developer
well this is mine, please configuration with yours ya
//here is controller Code: $id_user=$this->session->userdata('id_user'); //here is my id which is store in variable //here is model Code: function getimagestopright($id_user) Hope this help you |
Welcome Guest, Not a member yet? Register Sign In |