Skip to content

Instantly share code, notes, and snippets.

@rapisenpai
Created April 4, 2023 07:01
Show Gist options
  • Save rapisenpai/1df954cebeea93f96444673eb19429e1 to your computer and use it in GitHub Desktop.
Save rapisenpai/1df954cebeea93f96444673eb19429e1 to your computer and use it in GitHub Desktop.
PHP Connect to MySQL
<?php
$servername = "localhost";
$username = "root";
$password = "";
$db = "ecommerce";
// Create connection
$con = mysqli_connect($servername, $username, $password,$db);
// Check connection
if (!$con) {
die("Connection failed: " . mysqli_connect_error());
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment