Does "mysqli::close" close persistent connections?

3k Views Asked by At

PHP doc says "mysql_close() will not close persistent links".

Is it the same with mysqli (mysqli::close()) ?

2

There are 2 best solutions below

3
On

No. The mysql_close() function closes only non persistent links. You can't close persistent links.

mysql_close() closes the non-persistent connection to the MySQL server that's associated with the specified link identifier. If link_identifier isn't specified, the last opened link is used.

source:php.net

0
On

Mysqli contains a built in auto cleanup which will close a handler.

You may want to have a read of http://php.net/manual/en/mysqli.persistconns.php