Re: If statement duplicating mysql records?

From: Date: Thu, 21 Jun 2007 17:58:24 +0000
Subject: Re: If statement duplicating mysql records?
References: 1 2 3 4 5 6 7 8  Groups: php.general 
Request: Send a blank email to php-general+get-257576@lists.php.net to get a copy of this message
Jason Pruim wrote: > > It's not quite making sense to me though... My understanding of IF > statements is if the condition is met it ignores all the other if's. Is > that not correct? At this point it's just me trying to figure things out > for my knowledge :) No, that's not how it works. If the condition is met, the contents of the if block are executed. If not, and there is an ELSE block, those commands are executed. Then, the script continues after the whole if/then/else structure. Maybe you are thinking of an IF/ELSEIF/ELSEIF/.../ELSE structure? if ( $row[5] == "Level1" ) { // your commands } elseif ( $row[5] == "Level2" ) { // your commands } else { // your commands } This would work in the way you are thinking. Hope this helps your understanding. -- Roberto Mansfield Institutional Research and Application Development (IRAD) SAS Computing

« previous php.general (#257576) next »