Subject Re: [firebird-php] Processing Firebird errors in PHP
Author Todd Cary
Tom -

I check for errors like division by zero or using a null for an integer
before issuing the query. However, you most likely have a more
streamlined way of doing it, so if you have some suggestions, please
pass them on.


Thomas Beckmann wrote:

>Hi Todd,
>I use my own DB-layer, that contains a property holding the current error
>state. Do you just want to know, how we are doing it, or do you have
>precise problem? Your code does not show errors on logical problems (like
>division by zero) yet, because these occur on fetch time...
>Todd Cary schrieb:
>>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.

Ariste Software
200 D Street Ext
Petaluma, CA 94952
(707) 773-4523

[Non-text portions of this message have been removed]