config.php update

remotes/origin/database-api-implementation
Dorian HODIN 2 years ago committed by felixmielcarek
parent 43275a8902
commit ff39f1cb84

@ -1,13 +1,14 @@
<?php <?php
$username="dafldev"; //Get the username $username="dafldev"; //Get the username
$host="89.83.53.34"; //Get the address IP of the hosting machine $host="89.83.53.33"; //Get the address IP of the hosting machine
$password="wrap"; //Get the password for the user selected $password="wrap"; //Get the password for the user selected
$db_name="positiondaflmusic"; //Get the name of the database $db_name="positiondaflmusic"; //Get the name of the database
try { //Try to connect to the database
$connect = mysqli_connect($host, $username, $password, $db_name); //Connecting to database $connect = mysqli_connect($host, $username, $password, $db_name); //Connecting to database
}catch (mysqli_sql_exception){ //If the connection failed
if (mysqli_connect_errno()) { //Check 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("Failed to connect to MySQL")); //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 exit(-1); //Send a return code as -1, so insert.php can know if the connection is successful
} }

Loading…
Cancel
Save