位置: 编程技术 - 正文

PHP:pg_set_error_verbosity()的用法_PostgreSQL函数

编辑:rootadmin
pg_set_error_verbosity

推荐整理分享PHP:pg_set_error_verbosity()的用法_PostgreSQL函数,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 5 >= 5.1.0)

pg_set_error_verbosity — Determines the verbosity of messages returned by pg_last_error() and pg_result_error().

说明 int pg_set_error_verbosity ([ resource $connection ], int $verbosity )

Determines the verbosity of messages returned by pg_last_error() and pg_result_error().

pg_set_error_verbosity() sets the verbosity mode, returning the connection&#;s previous setting. In PGSQL_ERRORS_TERSE mode, returned messages include severity, primary text, and position only; this will normally fit on a single line. The default mode (PGSQL_ERRORS_DEFAULT) produces messages that include the above plus any detail, hint, or context fields (these may span multiple lines). The PGSQL_ERRORS_VERBOSE mode includes all available fields. Changing the verbosity does not affect the messages available from already-existing result objects, only subsequently-created ones.

参数

connection PHP:pg_set_error_verbosity()的用法_PostgreSQL函数

PostgreSQL database connection resource. When connection is not present, the default connection is used. The default connection is the last connection made by pg_connect() or pg_pconnect().

verbosity

The required verbosity: PGSQL_ERRORS_TERSE, PGSQL_ERRORS_DEFAULT or PGSQL_ERRORS_VERBOSE.

返回值

The previous verbosity level: PGSQL_ERRORS_TERSE, PGSQL_ERRORS_DEFAULT or PGSQL_ERRORS_VERBOSE.

范例

Example #1 pg_set_error_verbosity() example

<?php$dbconn=pg_connect("dbname=publisher")ordie("Couldnotconnect");if(!pg_connection_busy($dbconn)){pg_send_query($dbconn,"select*fromdoesnotexist;");}pg_set_error_verbosity($dbconn,PGSQL_ERRORS_VERBOSE);$res1=pg_get_result($dbconn);echopg_result_error($res1);?>

参见

pg_last_error() - 得到某连接的最后一条错误信息 pg_result_error() - 获得查询结果的错误信息

PHP:pg_set_client_encoding()的用法_PostgreSQL函数 pg_set_client_encoding(PHP4=4.0.3,PHP5)pg_set_client_encoding设定客户端编码说明intpg_set_client_encoding([resource$connection],string$encoding)pg_set_client_encoding()设定客户端编码方

PHP:pg_send_query()的用法_PostgreSQL函数 pg_send_query(PHP4=4.2.0,PHP5)pg_send_query发送异步查询说明boolpg_send_query(resource$connection,string$query)boolpg_send_query(string$query)pg_send_query()向connection连接发送异步查

PHP:pg_send_query_params()的用法_PostgreSQL函数 pg_send_query_params(PHP5=5.1.0)pg_send_query_paramsSubmitsacommandandseparateparameterstotheserverwithoutwaitingfortheresult(s).说明boolpg_send_query_params(resource$connection,string$query,array$p

本文链接地址:https://www.jiuchutong.com/biancheng/281133.html 转载请保留说明!

上一篇:PHP:pg_trace()的用法_PostgreSQL函数(php -i)

下一篇:缴住房公积金会计分录怎么写?(住房公积金会扣税吗)

免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络