ID: 26411
Updated by: [EMAIL PROTECTED]
Reported By: php at bellytime dot com
-Status: Open
+Status: Feedback
Bug Type: Feature/Change Request
Operating System: FreeBSD
PHP Version: Irrelevant
New Comment:
Can you give a better example to support your request? Your example can
easily be written as:
while ($row = mysql_fetch_assoc($result)) {
print 'Here is a result';
...
}
if (!row) {
print 'No results found';
}
I don't think that this one test is so expensive that it makes it worth
the trouble (and cost) to clutter up the language.
Previous Comments:
------------------------------------------------------------------------
[2003-11-25 12:28:30] php at bellytime dot com
Description:
------------
How about a while...else structure. Often we do
if (!mysql_num_rows($result)) {
print 'No results found';
}
while ($row = mysql_fetch_assoc($result)) {
print 'Here is a result';
...
}
Wouldn't it be nicer to do a
while ($row = mysql_fetch_assoc($result)) {
print 'Here is a result';
...
} else {
print 'No results found';
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26411&edit=1