CodeIgniter Forums
how to pass session from one function to another - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: how to pass session from one function to another (/showthread.php?tid=36210)



how to pass session from one function to another - El Forum - 11-25-2010

[eluser]praveena[/eluser]
I was unble to pass session from one function to another function it was not taking any values showing null
please help me


how to pass session from one function to another - El Forum - 11-25-2010

[eluser]InsiteFX[/eluser]
Do you want to explain it more?

InsiteFX


how to pass session from one function to another - El Forum - 11-26-2010

[eluser]praveena[/eluser]
ya i was able to pass the I assigned to the variable but I was not able to assign the variable to the query

$query=$this->db->query('SELECT comnyname,address1,address2,city,province,country,postal_code,phone,fax,emailid,overview,solutions,
date FROM master WHERE user_id='.$userid1);

.$userid1 this is session id


how to pass session from one function to another - El Forum - 11-26-2010

[eluser]smilie[/eluser]
May I ask, why don't you use:

Code:
$query=$this->db->query(‘SELECT comnyname,address1,address2,city,province,country,postal_code,phone,fax,emailid,overview,solutions,
date FROM master WHERE user_id=’.$this->session->userdata("userid");

Cheers,
Smilie