config.php update
continuous-integration/drone/push Build is passing Details

remotes/origin/mvc-implementation
Dorian HODIN 2 years ago
parent 3b13074ac6
commit 5e0778e4ce

@ -1,12 +1,13 @@
<?php
$username=$_ENV("INNONDB_USER"); //Get the username
$host=$_ENV("INNONDB_HOST"); //Get the address IP of the hosting machine
$password=$_ENV("INNONDB_PASSWORD"); //Get the password for the user selected
$db_name=$_ENV("INNONDB_DATABASE"); //Get the name of the database
$username=getenv("INNONDB_USER"); //Get the username
$host=getenv("INNONDB_HOST"); //Get the address IP of the hosting machine
$password=getenv("INNONDB_PASSWORD"); //Get the password for the user selected
$db_name=getenv("INNONDB_DATABASE"); //Get the name of the database
try { //Try to connect to the database
$connect = mysqli_connect($host, $username, $password, $db_name); //Connecting to database
}catch (mysqli_sql_exception){ //If the connection failed
print(json_encode("Failed to connect to MySQL, connection timeout")); //Return a json string, so the dart script can interpret the error
print(json_encode($host,$username));
//print(json_encode("Failed to connect to MySQL, connection timeout")); //Return a json string, so the dart script can interpret the error
exit(-1); //Send a return code as -1, so insert.php can know if the connection is successful
}

Loading…
Cancel
Save