PHP mysqli_close() Function

Definition

The mysqli_close() function closes a previously opened database connection.

Syntax

PHP mysqli_close() Function has the following syntax.

mysqli_close(connection);

Parameter

ParameterIs RequiredDescription
connectionRequired.MySQL connection

Return

It returns TRUE on success or FALSE on failure.

Example

The following code closes a previously opened database connection.


<?php/*from  w  ww  .  jav a  2  s  . com*/
$con=mysqli_connect("localhost","my_user","my_password","my_db");


mysqli_close($con);
?>




















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions