mysql_close

bool mysql_close(mysql link connection) 

Closes a MySQL connection.

Returns:

TRUE on success; FALSE on failure

Description:

mysql_close() closes a MySQL connection opened by mysql_connect(). The connection to close is specified with the connection argument. If no argument is specified, the last opened connection is closed.

Use of this function is not required. Connections opened by mysql_connect() close automatically on script exit.

Note:

mysql_close() cannot close the persistent connections that are opened by mysql_pconnect(). These connections last beyond the life of the script that opened them. PHP closes them as needed.

Version:

PHP 3+, PHP 4+

See also:

To connect to a MySQL server:

mysql_connect() 
mysql_pconnect() 

Examples: ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.