Connection Failed: php_network_getaddresses: getaddrinfo failed: No such host is known

29
February 11, 2019, at 4:00 PM

Warning: mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\xampp\htdocs\Hostel-Management-System-master\includes\config.inc.php on line 8 Connection Failed: php_network_getaddresses: getaddrinfo failed: No such host is known.

This is my code:

<?php
session_start();
$SERVERNAME = "hms.test";
$DBUSERNAME = "root";
$DBPASSWORD = "root";
$DBNAME = "hostel_management_system";
$conn=mysqli_connect($SERVERNAME, $DBUSERNAME, $DBPASSWORD, $DBNAME);
if (!$conn) {
die("Connection Failed: ".mysqli_connect_error());

}
?>
READ ALSO
How to differentiate data to be read between two tables when username and password is passed

How to differentiate data to be read between two tables when username and password is passed

I am using volley in my mobile development login and instead of one table, I used two

33
Avoid inserting duplicate data in csv with PHP

Avoid inserting duplicate data in csv with PHP

I store data into a csv file by this:

23
Why can&#39;t I connect to database in xampp? [on hold]

Why can't I connect to database in xampp? [on hold]

I have read all the answers relating to this issue but i couldn't come up with any solutionI have changed config

30