Subject Re: [firebird-php] Trapping errors
Author Milan Babuskov
myles@... wrote:
> However if Firebird returns an error related to, for example, a violation of
> a unique index constraint on a column on a table, my PHP code doesn't
> receive it until it gets to Fetch any data back from a query.

Violation of Unique happens only on INSERT and UPDATE, so there isn't
anything to fetch?

> And when it does get these errors returned, they are returned as general PHP
> errors with the Firebird error message embedded in the 'Warning' area of the
> PHP error.

I've set those to OFF:

error_reporting(0);

As for the error handling, I use something like this:

$result = ibase_query("insert into ... values ...");
if (!$result)
echo "ERROR: ".ibase_errmsg();

As you can see, you can check if statement is executed successfully by
checking the return value of ibase_query. And ibase_errmsg() returns
textual error message related to last statement that was executed.


--
Milan Babuskov
http://swoes.blogspot.com/
http://www.flamerobin.org