db2_close

(PECL ibm_db2 >= 1.0.0)

db2_close Closes a database connection

说明

db2_close ( resource $connection ) : bool

This function closes a DB2 client connection created with db2_connect() and returns the corresponding resources to the database server.

If you attempt to close a persistent DB2 client connection created with db2_pconnect(), the close request is ignored and the persistent DB2 client connection remains available for the next caller.

参数

connection

Specifies an active DB2 client connection.

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

范例

Example #1 Closing a connection

The following example demonstrates a successful attempt to close a connection to an IBM DB2, Cloudscape, or Apache Derby database.

<?php
$conn 
db2_connect('SAMPLE''db2inst1''ibmdb2');
$rc db2_close($conn);
if (
$rc) {
    echo 
"Connection was successfully closed.";
}
?>

以上例程会输出:

Connection was successfully closed.

参见

相关文章
php ibm db2 函数 returns or sets the autocommit state for a database connectionphp ibm db2 函数 returns an object with properties that describe the db2 database clientphp ibm db2 函数 closes a database connectionphp ibm db2 函数 returns a string containing the sqlstate returned by the last connection attemptphp ibm db2 函数 returns the last connection error message and sqlcode valuephp ibm db2 函数 returns a connection to a databasephp ibm db2 函数 returns an array indexed by column position representing a row in a result setphp ibm db2 函数 returns an array indexed by column name representing a row in a result setphp ibm db2 函数 retrieves an option value for a statement resource or a connection resourcephp ibm db2 函数 returns the auto generated id of the last insert query that successfully executed on this connectionphp ibm db2 函数 closes a persistent database connectionphp ibm db2 函数 returns a persistent connection to a databasephp ibm db2 函数 returns a result set listing the stored procedures registered in a databasephp ibm db2 函数 returns an object with properties that describe the db2 database serverphp ibm db2 函数 set options for connection or statement resourcesphp ibm db2 函数 returns a result set listing the index and statistics for a tablephp ibm db2 函数 returns a result set listing the tables and associated privileges in a databasephp ibm db2 函数 returns a result set listing the tables and associated metadata in a databasephp firebird/interbase 函数 open a persistent connection to an interbase databasephp maxdb 函数 closes a previously opened database connection
关注编程学问公众号