added www
This commit is contained in:
15
www/test_db_pdo.php
Normal file
15
www/test_db_pdo.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
$DBuser = 'root';
|
||||
$DBpass = $_ENV['MYSQL_ROOT_PASSWORD'];
|
||||
$pdo = null;
|
||||
|
||||
try{
|
||||
$database = 'mysql:host=database:3306';
|
||||
$pdo = new PDO($database, $DBuser, $DBpass);
|
||||
echo "Success: A proper connection to MySQL was made! The docker database is great.";
|
||||
} catch(PDOException $e) {
|
||||
echo "Error: Unable to connect to MySQL. Error:\n $e";
|
||||
}
|
||||
|
||||
$pdo = null;
|
||||
Reference in New Issue
Block a user