Question: I'm trying to connect to Mysql database with following Php code. But I get 2 error message.

**Mysql Connect Code:**

```
<?php
define("HOST", "localhost" );
define("USER", "root");
define("PASS", "");
define("DB", "classified");

mysql_connect("HOST", "USER") or die("Cannot connect to database");;
mysql_select_db("DB") or die("Cannot connect to select db");
?>

```

**Error Message:**

```
Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: No such host   
is known. in D:\Software\Installed\xampp\htdocs\Classified-website\toplevel\content
\database\databd.php on line 7

Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: No such host 
is known. in D:\Software\Installed\xampp\htdocs\Classified-website\toplevel\content
\database\databd.php on line 7

Cannot connect to database.

```

Why I get this 2 error message. If i use without define function then it's working. BUT..

Answer: 
Remove the quotes from 
`mysql_connect("HOST", "USER")`

To
`mysql_connect(HOST, USER)`

As they are defined constants - if you use the quotes, it's taking HOST and USER as a string literal.
You are not supposed to use quotes around hostname and db name.

Try: `mysql_connect(HOST, USER)` instead of `mysql_connect("HOST", "USER")`. Try same thing for db name.

Happy Coding!!