Posted by Ian Collins on 02/02/06 08:54
joe wrote:
> I have a system where include files puts generated HTML into a variable
> ( $output ).
>
> In one of the pages I have a function that executes SQL queries and
> return nice arrays.
>
> The command to abort an included script is 'return' - but not if you're
> within a function. Then 'return' simply aborts that function.
>
> If the query should fail for some reason, I'd like to overwrite $output
> with a nice err. msg. and then abort execution of the included script
> and return to the main script. But can that be done from within a
> function ?
>
Throw an exception?
--
Ian Collins.
[Back to original message]
|