pg_errormessage

(PHP 3 <= 3.0.18, PHP 4 >= 4.0.0)

pg_errormessage -- Get the last error message string of a connection

Description

string pg_errormessage (resource connection)

pg_errormessage() returns a string containing the last error message for given connection. It returns FALSE on failure.

pg_errormessage() returns the last error message for given connection and error message may be overwritten if other libpq functions are called on the connection. PostgreSQL functions calls libpq functions internally. Therefore, details about the error may not be retrieved using the pg_errormessage() function. pg_result_error_message() will be added from 4.2.0 to get last error for the result resource.