I have a MySql database set up on the johnny server and I'm trying to connect to it in a PHP-based webapp that I'm hosting locally with XAMMP. I've already added my local ip to Remote MySQL and added my user to the database. My config file looks like this:
<?php
// Database credentials
define('DB_SERVER', 'johnny.heliohost.com');
define('DB_USERNAME', 'myusername');
define('DB_PASSWORD', 'mypassword');
define('DB_NAME', 'mydatabasename');
/* Attempt to connect to MySQL database */
$mysqli = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
// Check connection
if($mysqli === false){
die("ERROR: Could not connect. " . $mysqli->connect_error);
}
?>
When I load the page, all of the mysqli queries fail with this error message: "Warning: mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server."
Can anyone spot what I'm doing wrong? I've tried reading the documentation for information on how to connect remotely, but I wasn't able to get much from them.