[eluser]saidai jagan[/eluser]
[quote author="ceig" date="1265803861"]i hav set session in login page by
$this->session->set_userdata('$role');
$role is from database
then i used ur code to send the values
$data = array(
'page_title' => 'Students',
'students' => $students->result(),
'role_id' => $this->session->user_data('role_id');
);
$this->load->view('students/list',$data);
how to get this value in view
i hav to store it in a variable
please help[/quote]
By this code alter it to
Code:
$role_ids = array('role_id' => $role);
$this->session->set_userdata($role_ids);
$data = array(
'page_title' => 'Students',
'students' => $students->result(),
'role_id' => $this->session->userdata('role_id');
);
echo $data['role_id'];
Note : students/list is already there. I just copied the code.