(PECL CUBRID >= 8.3.0)
cubrid_disconnect — 关闭数据库连接
cubrid_disconnect() 函数关闭连接句柄并断开与服务器的连接。如果此时有任何请求句柄未关闭,它将被关闭。它类似于 CUBRID MySQL 兼容函数 cubrid_close()。
conn_identifier
连接标识符。
示例 #1 cubrid_disconnect() 示例
<?php
$con = cubrid_connect ("localhost", 33000, "demodb");
if ($con) {
echo "连接成功";
$req = cubrid_execute( $con, "create table person(id int,name char(10))");
if ($req) {
cubrid_close_request($req);
cubrid_commit($con);
} else {
cubrid_rollback($con);
}
$req = cubrid_execute( $con, "insert into person values(1,'James')");
if ($req) {
cubrid_close_request($req);
cubrid_commit($con);
} else {
cubrid_rollback($con);
}
cubrid_disconnect($con);
}
?>