Home  >  Article  >  Backend Development  >  Which PHP function is used to disconnect from MySQL database?

Which PHP function is used to disconnect from MySQL database?

WBOY
WBOYforward
2023-09-05 13:09:07945browse

Which PHP function is used to disconnect from MySQL database?

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 -

Syntax

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!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete