Session data |
[eluser]triplewhat[/eluser]
How do I add information from the database to the session? I am new and trying to learn this. Sorry I have a model with this info Code: function validate() And then a controller with this Code: public function validate_credentials(){ I am trying to add title to the session
[eluser]InsiteFX[/eluser]
Code: $data = array(
[eluser]triplewhat[/eluser]
I don't want to set the title there, i want to pull it from the database. It is already set there. The menu will changed based on the users title
[eluser]InsiteFX[/eluser]
Well put it from your database and set it thats how you do it!
[eluser]triplewhat[/eluser]
Its in my database I dont know how to select it, or how to call it, please don't answer me like that. I need examples
[eluser]triplewhat[/eluser]
I selected it in the model, how to i retrieve it in the controller, or is that the wrong way. I need examples please.
[eluser]Ajaxboy[/eluser]
Did you already went through the docs? http://ellislab.com/codeigniter/user-gui...sions.html
[eluser]triplewhat[/eluser]
yes. I dont understand how to get the value of title into an array to add to session data
[eluser]triplewhat[/eluser]
[quote author="InsiteFX" date="1335065627"]Well put it from your database and set it thats how you do it! [/quote] And how exactly do I do that
[eluser]Ajaxboy[/eluser]
I created my own session class so I am not making use of the CI session class.. but my understanding is that to get data you would do this: $this->session->userdata('title'); $this->session->userdata('username'); $this->session->userdata('logged_in'); |
Welcome Guest, Not a member yet? Register Sign In |