why to close connection to database in php code example Example: close mysql connection in php // OOP $conn->close(); //Procedural mysqli_close($conn);