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 resultSYNOPSISstring pg_result_error (resource $result)DESCRIPTIONpg_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.PARAMETERSo $result - PostgreSQL query result resource, returned by pg_query(3), pg_query_params(3) or pg_execute(3) (among others).RETURN VALUESReturns a string. Returns empty string if there is no error. If there is an error associated with the $result parameter, returns FALSE.EXAMPLESExample #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 ALSOpg_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_prepare(3) - php |
pg_fetch_object(3) - php |
pg_field_size(3) - php |
pg_query_params(3) - php |
pg_send_prepare(3) - php |
Similar Topics in the Unix Linux Community |
---|
Rules for Homework & Coursework Questions Forum |
UNIX.COM 2017 Year End Summary |
Coming Soon: Upgrade Forum Software (Dec 31 - Jan 1) |
Please Welcome Don Cragun as Lead Moderator |