位置: 编程技术 - 正文
推荐整理分享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.
Cautionpg_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.
参数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
标签: PHP:pg_transaction_status()的用法_PostgreSQL函数
本文链接地址:https://www.jiuchutong.com/biancheng/281130.html 转载请保留说明!上一篇:PHP:pg_tty()的用法_PostgreSQL函数(php statement)
下一篇:PHP:pg_socket()的用法_PostgreSQL函数(php socket_read)
友情链接: 武汉网站建设