Re: if elseif elseif elseif....
| From: | Chris | Date: | Thu, 05 Mar 2009 00:59:53 +0000 |
| Subject: | Re: if elseif elseif elseif.... | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-289313@lists.php.net to get a copy of this message | ||
Shawn McKenzie wrote:
Chris wrote:Yeh that's what I was trying to say, just did it poorly ;) -- Postgresql & php tutorials http://www.designmagick.com/PJ wrote:Yes and yes, however the it's the result of the assignment that is used: if($var = false) { echo "Succeeded"; } else { echo "FAIL"; }Daniel Brown wrote:Using a single = means an assignment. Assigning a variable should never fail. You probably want == to do a comparison.On Wed, Mar 4, 2009 at 17:51, PJ <af.gourmet@videotron.ca> wrote:That's where the problem lies... the algorhythm is if any one of a series is empty, then it's an error, but if they are all ls then we go on... So the last one should show up as "0"...elseif ($obligatoryFieldNotPresent = 1) {Are you certain you only wanted a single equal operator in the last elseif() condition? Further, are you sure it should even be an elseif() and not a straight else?$obligatoryFieldNotPresent = 0;}