so this is my code:
<?php
class DB{
private $host = 'loscalhost';
private $user = 'root';
private $password = '';
function __construct(){
try {
$connect_db = mysql_connect($this->host, $this->user, $this->password);
}catch(Exception $e){
echo 'DB connection failed: ', var_dump($e), "\n";
}
}
}
I changed the host variable value so i can display the message DB connection failed..., but my question is why is it not displayed? instead i get this: Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known