PHP provides us with the mysql_close() function, with which we can disconnect from the MySQL database at any time. This function takes a single parameter, which is the connection returned by the mysql_connect() function. The syntax is as follows -
bool mysql_close ( resource $link_identifier );
Here, if no resource is specified, the last opened database will be closed. This function returns true if the connection is closed successfully, false otherwise.
The above is the detailed content of Which PHP function is used to disconnect from MySQL database?. For more information, please follow other related articles on the PHP Chinese website!