note 25723 added to language.operators.logical
| From: | shiyaz at bml dot com dot mv | Date: | Thu, 03 Oct 2002 07:50:37 +0000 |
| Subject: | note 25723 added to language.operators.logical | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-37597@lists.php.net to get a copy of this message | ||
i found that the conditional or (||) is was very handy when searching a resultset for a specific row
that matches a certain field. If a normal or (|) is used the following procedure will return the
following row(after fetching the next row), but since it does not evaluated the second condition the
row stays the same when the first condition is met.
$found=false;
while( (!$found) && odbc_fetch_row($rst) ){
if (odbc_result($rst, 1) == $sid )
$found=true;
}
echo odbc_result($rst,1);
--
http://www.php.net/manual/en/language.operators.logical.php
http://master.php.net/manage/user-notes.php?action=edit+25723
http://master.php.net/manage/user-notes.php?action=delete+25723
http://master.php.net/manage/user-notes.php?action=reject+25723