Detailed db error codes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I work with PHP5 and PostgreSQL7.4
Currently (for testing purpose) my script catches
the db errors and echoes them to a client without
any manipulation. But I need to examine these errors
and echo messages according the error type/class.
>From the PostgreSQL doc:

...All messages emitted by the PostgreSQL server are assigned five-character
error codes that follow the SQL standard's conventions for "SQLSTATE" codes.
Applications that need to know which error condition has occurred should
usually test the error code, rather than looking at the textual error
message. The error codes are less likely to change across PostgreSQL
releases, and also are not subject to change due to localization of error
messages...

Anybody know how to get the PostgreSQL error code/class in PHP?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux