Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yesenvidnath/785da42385f67c746d237ba5e3f5f621 to your computer and use it in GitHub Desktop.
Save yesenvidnath/785da42385f67c746d237ba5e3f5f621 to your computer and use it in GitHub Desktop.
Basic PhP Connection
<?php
$servername = "localhost";
$username = "root";
$password = "1234"; // Optional for the users
$database = "geoffryx_db";
// Create connection
$conn = new mysqli($servername, $username, $password, $database);
// 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