位置: 编程技术 - 正文

PHP:pg_transaction_status()的用法_PostgreSQL函数

编辑:rootadmin
pg_transaction_status

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

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

(PHP 5 >= 5.1.0)

pg_transaction_status — Returns the current in-transaction status of the server.

说明 int pg_transaction_status ( resource $connection )

Returns the current in-transaction status of the server.

Caution

pg_transaction_status() will give incorrect results when using a PostgreSQL 7.3 server that has the parameter autocommit set to off. The server-side autocommit feature has been deprecated and does not exist in later server versions.

参数 PHP:pg_transaction_status()的用法_PostgreSQL函数

connection

PostgreSQL database connection resource.

返回值

The status can be PGSQL_TRANSACTION_IDLE (currently idle), PGSQL_TRANSACTION_ACTIVE (a command is in progress), PGSQL_TRANSACTION_INTRANS (idle, in a valid transaction block), or PGSQL_TRANSACTION_INERROR (idle, in a failed transaction block). PGSQL_TRANSACTION_UNKNOWN is reported if the connection is bad. PGSQL_TRANSACTION_ACTIVE is reported only when a query has been sent to the server and not yet completed.

范例

Example #1 pg_transaction_status() example

<?php$dbconn=pg_connect("dbname=publisher")ordie("Couldnotconnect");$stat=pg_transaction_status($dbconn);if($stat===PGSQL_TRANSACTION_UNKNOWN){echo'Connectionisbad';}elseif($stat===PGSQL_TRANSACTION_IDLE){echo'Connectioniscurrentlyidle';}else{echo'Connectionisinatransactionstate';}?>

PHP:pg_socket()的用法_PostgreSQL函数 pg_socket(PHP5=5.6.0)pg_socketGetareadonlyhandletothesocketunderlyingaPostgreSQLconnection说明resourcepg_socket(resource$connection)pg_socket()returnsareadonlyresourcecorrespondingtothesocketunderly

PHP:pg_trace()的用法_PostgreSQL函数 pg_trace(PHP4=4.0.1,PHP5)pg_trace启动一个PostgreSQL连接的追踪功能说明boolpg_trace(string$pathname[,string$mode[,resource$connection]])pg_trace()启动PostgreSQL前端/后端通讯的追

PHP:pg_set_error_verbosity()的用法_PostgreSQL函数 pg_set_error_verbosity(PHP5=5.1.0)pg_set_error_verbosityDeterminestheverbosityofmessagesreturnedbypg_last_error()andpg_result_error().说明intpg_set_error_verbosity([resource$connection],int$verbosit

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

上一篇:PHP:pg_tty()的用法_PostgreSQL函数(php statement)

下一篇:PHP:pg_socket()的用法_PostgreSQL函数(php socket_read)

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

鄂ICP备2023003026号

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

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