PHP mysqli_close() Function
In this chapter you will learn:
- Definition for PHP mysqli_close() Function
- Syntax for PHP mysqli_close() Function
- Parameter for PHP mysqli_close() Function
- Return for PHP mysqli_close() Function
- Example - closes a previously opened database connection
Definition
The mysqli_close() function closes a previously opened database connection.
Syntax
PHP mysqli_close() Function has the following syntax.
mysqli_close(connection);
Parameter
Parameter | Is Required | Description |
---|---|---|
connection | Required. | MySQL connection |
Return
It returns TRUE on success or FALSE on failure.
Example
The following code closes a previously opened database connection.
<?php/*from j a va 2 s . c o m*/
$con=mysqli_connect("localhost","my_user","my_password","my_db");
mysqli_close($con);
?>
Next chapter...
What you will learn in the next chapter:
- Definition for PHP mysqli_commit() Function
- Syntax for PHP mysqli_commit() Function
- Parameter for PHP mysqli_commit() Function
- Return for PHP mysqli_commit() Function
- Example - turns off auto-committing, makes some queries, then commits the queries
Home » PHP Tutorial » PHP MySQLi Functions