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 answers

3
Pethical 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
ashryalls 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