略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: mysqli::close

2024-11-14

mysqli::close

mysqli_close

(PHP 5, PHP 7, PHP 8)

mysqli::close -- mysqli_close关闭先前打开的数据库连接

说明

面向对象风格

mysqli::close(): bool

过程化风格

mysqli_close(mysqli $link): bool

关闭先前打开的数据库连接

参数

mysql

仅以过程化样式:由mysqli_connect()mysqli_init() 返回的 mysqli 对象。

返回值

成功时返回 true, 或者在失败时返回 false

范例

See mysqli_connect().

参见

add a noteadd a note

User Contributed Notes 1 note

up
-38
php at dafydd dot com
13 years ago
I've had situations where database connections appeared to persist following php execution. So, now, my __destructor function explicitly contains a $cxn->close(). It hurts nothing, and helps avoid memory leaks.

官方地址:https://www.php.net/manual/en/mysqli.close.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3