HEY"; 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 }