RE: [PEAR] error returning with PEAR::DB

From: Date: Tue, 30 Mar 2004 20:42:59 +0000
Subject: RE: [PEAR] error returning with PEAR::DB
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-11549@lists.php.net to get a copy of this message
> On Tuesday 30 March 2004 17:15, Nelson E. Castillo wrote: > > You could (but probably should not) parse the DBMS > > user message to tell what happened. I would prefer > > to do the query to find out whether the user > > exists. It will be rather fast if you set an index > > for the 'username' field -if it's not not your > > primary key-. > Parsing the DBMS output would make my implementation DBMS > dependant making the > whole PEAR::DB idea irrelevant. > I really don't understand why the DBMS don't throw specific errors that a > database layer could parse to provide structures of what went wrong. This is exactly what DB is doing - it's DB independent. Just check for the respective constant like Lukas suggested. Regards, Torsten Roehr

« previous php.pear.general (#11549) next »