NYCPHP Meetup

NYPHP.org

[nycphp-talk] question re DB_Error (PEAR)

David Mintz dmintz at davidmintz.org
Fri Mar 19 15:44:20 EST 2004


On Fri, 19 Mar 2004, Mitch Pirtle wrote:

> David Mintz wrote:
>
> > There is no method that returns the native error code, to get it you have
> > to do something like parse it out of the string returned by getUserInfo()
> >
> > True or false?
>
> False.
>
> if ( DB::isError( $result ) ) {
> 	die ( $result->getDebugInfo() );
> }

Nuh uh. That's why I said "something *like* parse it out of the string
returned by..." [emphasis added] (-: The string returned by getDebugInfo()
is identical (well ok, I mean == ) to that returned by getUserInfo() in
the code I'm playing with right now.

The point being, it looks like you gotta use something like mysql_errno()
(in which case, so much for your abstraction) or parse it yourself.

Hardly the end of the world, just... interesting. Sort of.



---
David Mintz
http://davidmintz.org/

        "Anybody else got a problem with Webistics?" -- Sopranos 24:17



More information about the talk mailing list