|
|
@ -6,8 +6,7 @@ $db_name=getenv("INNONDB_DATABASE");
|
|
|
|
try { //Try to connect to 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
|
|
|
|
}catch (mysqli_sql_exception){ //If the connection failed
|
|
|
|
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
|
|
|
|
//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
|
|
|
|
exit(-1); //Send a return code as -1, so insert.php can know if the connection is successful
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|