From a user login form i need to use their username ($this->input->post('username'))
to query against the membership
table in my database so that I can retrieve the users firstname
and lastname
, which I believe should be done via a model called from my controller. I then need to pass that data back to my controller to use the firstname
and lastname
to add in to my session userdata
which is set in my controller, as shown below.
$data = array(
'username' => $this->input->post('username'),
'firstname' => //need to retrieve value from database,
'lastname' => //need to retrieve value from database,
'is_logged_in' => true
);
$this->session->set_userdata($data);
Thanks, Kristan.