Created
April 4, 2023 07:01
-
-
Save rapisenpai/1df954cebeea93f96444673eb19429e1 to your computer and use it in GitHub Desktop.
PHP Connect to MySQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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