Skip to content

Instantly share code, notes, and snippets.

@barmgeat
Last active December 27, 2020 13:58
Show Gist options
  • Save barmgeat/ae589a8bf06c959e0d34eae94a41ab05 to your computer and use it in GitHub Desktop.
Save barmgeat/ae589a8bf06c959e0d34eae94a41ab05 to your computer and use it in GitHub Desktop.
<?php
$servername = "HOSTNAME"; //Cpanel hostname to MySQL is: ****localhost**** .
$username = "USERNAME";
$password = "PASSWORD";
//Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
echo "Error connecting database: " . $conn->error;
die("Connection failed: " . $conn->connect_error);
}
echo "connected to the MySQL ...";
$conn->close();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment