Re: Making a true statement false.

From: Date: Fri, 07 Mar 2003 17:11:00 +0000
Subject: Re: Making a true statement false.
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-138656@lists.php.net to get a copy of this message
Mincu Alexandru wrote:
On Fri, 2003-03-07 at 18:16, ed@home.homes2see.com wrote:
Whenever I query a database with php I've always used the following code as a result.
this way: if (!$row = mysql_fetch_array($result)) { do something } else { do seomthing else }
It is simpler to do this: if ($row = mysql_fetch_array($result)) { do something else } else { do something } You would be well advised to use this syntax: if (!($row = mysql_fetch_array($result))) to ensure operator precedence is clear. (the equals followed by not) Regards, Greg -- phpDocumentor http://www.phpdoc.org

« previous php.general (#138656) next »