Re: Bizarre SQl, if issue....

From: Date: Tue, 29 Jul 2003 17:29:35 +0000
Subject: Re: Bizarre SQl, if issue....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-157343@lists.php.net to get a copy of this message
Did you try to print the content of the variable? What does it contain? On Tue, 29 Jul 2003 13:29:10 -0400 "Mike At Spy" <spycobalt@spyproductions.com> wrote: > > Hey, I've got a weird issue. I have some code, an MySQL statement, that > returns an empty set, like this: > > $person = mysql_query("Some Statement Here"); > > So, then I have an if/else statement: > > if (!$person || $person == 0 || $person == '' || $person == '0') { $result > = > 1; } > else { $result = 4; } > > If the SQL statement returns an empty set, shouldn't $result be equal to 1? > Instead, I'm getting $result = 4. > > Hence all of the 'OR' conditions. I would have have thought !$person would > be enough. > > Thanks for any input! :) > > -Mike > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Lucas Lain lainl@aconectarse.com # /Scripting/Manager (??) && /Obscure/Commander

« previous php.general (#157343) next »