isset $this->mError

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

isset $this->mError

Post by shiznatix »

i have a var returned from a class but after i call the class i do this

Code: Select all

$conn = new CoolClass;

echo $conn->mError;//this works perfect

if ($conn->mError)//this does NOT work
{
//do stuff
}

if ($conn->mError != NULL)//this does NOT work
{
//do stuff
}
why do the last 2 examples not work when the 1st one does work?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Show us the function.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

nevermind for some reason it didnt work last night but now it does work...
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

shiznatix wrote:nevermind for some reason it didnt work last night but now it does work...
LOL :P I love it when people say that.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

:cry: i don't but for some reason it seams to happen to me quite often, i think im cursed
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

LOL, the dumbest thing that happends to me ( Urmm rather often )

Editing a file and Refreshing your page without anychange thinking something didnt work untill you discover that you were editing the wrong file.

Like the backup.. s

Simular look just a differant dir :)
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

(this topic should probebly be moved to general discussion)
ol4pr0 wrote:LOL, the dumbest thing that happends to me ( Urmm rather often )

Editing a file and Refreshing your page without anychange thinking something didnt work untill you discover that you were editing the wrong file.

Like the backup.. s

Simular look just a differant dir :)
haha ya i have done that one many times. today, being monday of couse i wasted 2 hours becuase i was doing a while loop and it wasnt working. i couldnt figure it out and after extensive testing i saw that i had done this

Code: Select all

while ($condition = $thing);
{
//stuff here
}
now spot the error!
Post Reply