note 25723 deleted from language.operators.logical by betz
| From: | betz@php.net | Date: | Mon, 01 Nov 2004 14:05:57 +0000 |
| Subject: | note 25723 deleted from language.operators.logical by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79446@lists.php.net to get a copy of this message | ||
Note Submitter: shiyaz at bml dot com dot mv
----
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);