Connection Close in Php mysql
When the script ends then automatically connection will be closed. To close the connection before, use the following:
MySQLi Object-Oriented:
$conn->close();
MySQLi Procedural:
mysqli_close($conn);
PDO:
$conn = null;