CodeIgniter Forums
proper use of two conditions in using sessions? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter Archived (from EllisLab) (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: proper use of two conditions in using sessions? (/thread-7296.html)



proper use of two conditions in using sessions? - El Forum - 04-02-2008

[eluser]new_igniter[/eluser]
Hello,
Can anyone tell me the right syntax for using two conditions (in an if statement) while using CI sessions?

I tried:

if ($this->session->userdata('stat') != "OK" && $this->session->userdata('name') != "fred")
{
do something
}

this doesnt work and throws errors. My apologies in advance for being dumb.


proper use of two conditions in using sessions? - El Forum - 04-02-2008

[eluser]GSV Sleeper Service[/eluser]
that looks ok to me, what error do you get?


proper use of two conditions in using sessions? - El Forum - 04-02-2008

[eluser]new_igniter[/eluser]
I was being careless. It was something else! My bad, thanks Sleeper!!!