mysqli::close

mysqli_close

(PHP 5)

mysqli::close -- mysqli_closeCloses a previously opened database connection

說明

物件導向風格

bool mysqli::close ( void )

程序化風格

bool mysqli_close ( mysqli $link )

Closes a previously opened database connection.

參數

link

Procedural style only: A link identifier returned by mysqli_connect() or mysqli_init()

回傳值

如果成功則回傳 TRUE,失敗則回傳 FALSE

範例

See mysqli_connect().

參見

add a note add a note

User Contributed Notes 1 note

up
-38
php at dafydd dot com
15 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.
To Top