Reputation: 119
I am having issuing with session such after setting the session in my controller method, I be able to access in view but I cannot be able to access in model.
Here is the code:
public function get_username_ticket()
{
$user = $this->db->dbprefix('users');
$kq=$this->session->t_bys;
$sql = "SELECT $user.*
FROM $user
WHERE $user.deleted=0 AND $user.id = $kq";
return $this->db->query($sql)->row();
}
Upvotes: 1
Views: 271
Reputation: 3593
You should retrieve by:
$this->session->userdata('sessionVariable');
Upvotes: 1