|
-
Oct 20th, 2008, 01:31 PM
#1
Thread Starter
Lively Member
_______________________________
_______________________________
Last edited by Y.P.Y; Apr 28th, 2012 at 05:16 PM.
-
Oct 20th, 2008, 02:58 PM
#2
Re: Check 2 boolean values in return
Maybe I don't really understand what you mean, but why don't you just multiply the values together?
The only way the function will return true is if both are true.
-
Oct 20th, 2008, 04:08 PM
#3
Re: Check 2 boolean values in return
return $this->_Bln_QueryExcuted && $this->_Bln_RowsAffected
The result of the && operation is always a boolean. Therefore you just need to return that.
-
Oct 21st, 2008, 02:10 AM
#4
Thread Starter
Lively Member
Re: Check 2 boolean values in return
Thanks VisualAd. 
Also what is difference between:
return($_X ? $_Y= fale : $_Y= true) V.S. return($_X) ? $_Y= fale : $_Y= true;
Regards.
-
Oct 22nd, 2008, 06:09 PM
#5
Re: Check 2 boolean values in return
The first is syntactically valid but looks incorrect (or at best, misleading). The second is invalid.
The ternary conditional operator takes a boolean condition and two values. If the condition evaluates to true, the first value is returned; if not, the second.
The first snippet will evaluate $_X, then assign either false (if $_X is true) or true (if $_X is false) to $_Y, and return that.
-
Oct 23rd, 2008, 02:43 AM
#6
Thread Starter
Lively Member
Re: Check 2 boolean values in return
Thanks Penagate. Resolved .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|