NYCPHP Meetup

NYPHP.org

[nycphp-talk] question re DB_Error (PEAR)

Daniel Convissor danielc at analysisandsolutions.com
Fri Mar 19 18:41:55 EST 2004


Hi David:

On Fri, Mar 19, 2004 at 05:04:43PM -0500, David Mintz wrote:
> 
> again. The native error code is *contained* in the string returned by
> getUserInfo() so in that sense...  nevermind. (-:

Yeah, there's no method/property that contains the DBMS's native error
number.


> I know that PEAR has its own DB_ERROR_ALREADY_EXISTS constant and I guess
> that's the equivalent of MySQL's 1062.

Also, keep in mind, that MySQL is the only DBMS that uses that somewhat
vague ALREADY_EXISTS constant.  The others use DB_ERROR_CONSTRAINT.  
MySQL can be told to use the universal/correct constant, you can turn on
the DB_PORTABILITY_ERRORS error mapping portability option.
http://pear.php.net/manual/en/package.database.db.intro-portability.php

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list