php man page for pg_result_error

Query: pg_result_error

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

PG_RESULT_ERROR(3)														PG_RESULT_ERROR(3)

pg_result_error - Get error message associated with result

SYNOPSIS
string pg_result_error (resource $result)
DESCRIPTION
pg_result_error(3) 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(3). The function pg_result_error_field(3) can give much greater detail on result errors than pg_result_error(3). Because pg_query(3) returns FALSE if the query fails, you must use pg_send_query(3) and pg_get_result(3) to get the result handle.
PARAMETERS
o $result - PostgreSQL query result resource, returned by pg_query(3), pg_query_params(3) or pg_execute(3) (among others).
RETURN VALUES
Returns a string. Returns empty string if there is no error. If there is an error associated with the $result parameter, returns FALSE.
EXAMPLES
Example #1 pg_result_error(3) example <?php $dbconn = pg_connect("dbname=publisher") or die("Could not connect"); if (!pg_connection_busy($dbconn)) { pg_send_query($dbconn, "select * from doesnotexist;"); } $res1 = pg_get_result($dbconn); echo pg_result_error($res1); ?>
SEE ALSO
pg_result_error_field(3), pg_query(3), pg_send_query(3), pg_get_result(3), pg_last_error(3), pg_last_notice(3). PHP Documentation Group PG_RESULT_ERROR(3)
Related Man Pages
pg_parameter_status(3) - php
pg_execute(3) - php
pg_field_prtlen(3) - php
pg_field_size(3) - php
pg_query(3) - php
Similar Topics in the Unix Linux Community
Coming Soon: Upgrade Forum Software (Dec 31 - Jan 1)
Please Welcome Don Cragun as Lead Moderator
Status of UNIX.COM Forum Transformation
Please Welcome Ravinder Singh to the Moderation Team
Please Welcome Nicki Paul to the Moderator Team!