Home > PHP > Function > PostgreSQL > pg_result_error()

pg_result_error()

pg_result_error - Get error message associated with result

Syntax

string pg_result_error (resource $result)

Arguments

  • result - PostgreSQL query result resource, returned by pg_query(), pg_query_params() or pg_execute() (among others).

Description

pg_result_error() returns any error message associated with the result resource. Therefore, the user has a better chance of getting the correct error message than with pg_last_error().

Version

PHP 4.2.0, 5

Return value

Returns a string if there is an error associated with the result parameter, FALSE otherwise.