Skip to content

Instantly share code, notes, and snippets.

@antoinefortin
Created March 19, 2018 17:47
Show Gist options
  • Save antoinefortin/73b3a6410242251f5d937a18802b5a5c to your computer and use it in GitHub Desktop.
Save antoinefortin/73b3a6410242251f5d937a18802b5a5c to your computer and use it in GitHub Desktop.
[Connect to DB in Php]
<?php
$servername = "127.0.0.1";
$username = "root";
$password = "";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment