Re: If statement question

From: Date: Mon, 26 Jun 2006 18:23:18 +0000
Subject: Re: If statement question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-238652@lists.php.net to get a copy of this message
On Mon, 2006-06-26 at 14:10, Alex Major wrote: > Hi list. > Basically, I'm still learning new things about php and I was wondering if > things inside an if statement get 'looked at' by a script if the condition > is false. > For example, would this mysql query get executed if $number = 0 ? > > If ($number == 1) { > mysql_query($blah) > } > > I know that's not really valid php, but hope it gets my point across. I was > just wondering from an optimisation perspective, as I don't want sql > commands being executed when they don't need to be (unnecessary server > usage). I can't think of any language that processes the contents of a conditional block when the test condition fails. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

« previous php.general (#238652) next »