Created
August 4, 2020 11:59
-
-
Save ayoubbensakhria/8e16799462af91465699a28493ba88f7 to your computer and use it in GitHub Desktop.
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
<h1>Hello World!!!</h1> | |
<h4>Attempting MySQL connection from php...</h4> | |
<?php | |
// I assume that you've created a new username 'user' with password 'user' for a demo purpose | |
$host = 'mysql'; | |
$user = 'user'; | |
$pass = 'user'; | |
$conn = new mysqli($host, $user, $pass); | |
if ($conn->connect_error) { | |
die("Connection failed: " . $conn->connect_error); | |
} else { | |
echo "Connected to MySQL successfully!"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment