Subject RE: [firebird-php] Processing Firebird errors in PHP
Author Alan McDonald
Lester - how do these spam sex messages get thru? I can't find these emails
in the list
Alan

> -----Original Message-----
> From: firebird-php@yahoogroups.com
> [mailto:firebird-php@yahoogroups.com]On Behalf Of Lester Caine
> Sent: Thursday, 1 September 2005 4:47 PM
> To: firebird-php@yahoogroups.com
> Subject: Re: [firebird-php] Processing Firebird errors in PHP
>
>
> Todd Cary wrote:
>
> > I would appreciate some suggestions on how errors should be
> processed in
> > Apache/PHP. Here is a snippet of my current code:
> >
> > ...
> > $sthdl = ibase_query($stmnt,$dbh);
> > if ($sthdl) ibase_commit();
> > if (ibase_errmsg()) {
> > echo('Query: ' . $stmnt . '<br>');
> > echo ibase_errmsg();
> > exit;
> > }
> > return $sthdl;
> >
> > where $stmnt is the query statement. If I do not put the "exit" in the
> > code, the function will run giving erroneous results. I would like to
> > display an error page informing the surfer to contact the DBA.
> >
> > Any suggestions?
>
> Todd - if you know that you have an error, you just need to change the
> page that is created to tell you what the error is. In the above example
> you want to build either an error page, or a results page.
>
> if (ibase_errmsg()) {
> <Display Error Message>
> } else {
> <Display Results>
> }
>
> The 'exit;' is just another way of not providing the 'else' and is
> totally acceptable if not as tidy as showing the 'program flow'
>
> --
> Lester Caine
> -----------------------------
> L.S.Caine Electronic Services
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>