CodeIgniter Forums

Full Version: proper use of two conditions in using sessions?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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.

El Forum

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

El Forum

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