Re: Where to handle no results
| From: | David Robley | Date: | Tue, 04 Jul 2000 04:15:06 +0000 |
| Subject: | Re: Where to handle no results | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4673@lists.php.net to get a copy of this message | ||
On 4 Jul, Digital Hit Entertainment wrote:
> David Robley wrote:
>>
>> if ($numrows == 0):
>> break;
>> else:
>> do wonderful things
>> endif;
>
> That gave me a "Fatal error: Cannot break from 1 loop(s) from nesting
> level 0"
>
> Heading back to the drawing board. ;-)
> --
> Ian Evans
Reading the docs, we find that break only works in for, while or switch
structures. Oh well, so much for coding off the top of my head.
So, what about
if($numrows != 0):
do wonderful things
endif;
which is less typing anyway :-)
Cheers
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA