mysqli::close
mysqli_close
(PHP 5, PHP 7, PHP 8)
mysqli::close -- mysqli_close — 关闭先前打开的数据库连接
返回值
成功时返回 true
, 或者在失败时返回 false
。
范例
See mysqli_connect().
参见
- mysqli::__construct() - Open a new connection to the MySQL server
- mysqli_init() - 初始化 MySQLi 并返回一个资源类型的值,这个值可以作为 mysqli_real_connect() 函数的传入参数
- mysqli_real_connect() - 建立一个 MySQL 服务器连接
add a note
User Contributed Notes 1 note
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.