Close Connection

<?php $con=mysqli_connect("localhost","root","password","wp_db"); if (mysqli_connect_errno($con)) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } mysqli_close($con); ?>

1 Response

The connection will be closed automatically when the script ends. To close the connection before, use the mysqli_close() function:

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.