Subject Re: [firebird-php] Processing Firebird errors in PHP
Author Thomas Beckmann
> 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.
Well, Todd, you can't check in advance for a division by 0 error in
select 1/I from TESTTABLE; if you do not know the values of I...

Still, I do not understand your question.

The way of processing errors in a web application is not particular to
firebird...

>
> Todd
>
> 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.
>>>
>>>
>>
>>
>>
>>
>
>


--
Thomas.Beckmann@...
Martens & Prahl EDV, Wielandstr. 14c, 23558 Lübeck
Telefon 0451-39904-525 • Telefax -559