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.
(PHP 5)
mysqli::close -- mysqli_close — Closes a previously opened database connection
物件導向風格
程序化風格
Closes a previously opened database connection.
如果成功則回傳 TRUE
,失敗則回傳 FALSE
。
See mysqli_connect().
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.