I am going to use mysqli_close($connection)
to close the $connection
. But Before Closing I need to ensure that the concerned connection is open.
This is from PHP.net.
Object oriented style
connect_errno) { printf("Connect failed: %s\n", $mysqli->connect_error); exit(); } /* check if server is alive */ if ($mysqli->ping()) { printf ("Our connection is ok!\n"); } else { printf ("Error: %s\n", $mysqli->error); } /* close connection */ $mysqli->close(); ?>
Procedural style