title: Connection failed mysqli php
body: <p>I have set a connection to a mysql server (OVH) in PHP like this : </p>
  
  <pre><code>$con = mysqli_connect("myserver.mysql.db","user","pass","bdd") or die("Couldn't connect");
  </code></pre>
  
  <p>And it can't connect it, saying the host in unknow. But this is the only informations I have about the server</p>
  
  <p>What can I do to get over this problem ?</p>
  
  <p>Thanks </p>
  
  <p>EDIT : </p>
  
  <p>Here is php code : </p>
  
  <pre><code>class dbconnection{
      function connect(){
          $con = mysqli_connect("myserv.mysql.db","user","mdp","bdd") or die("Couldn't connect" .  $con-&gt;connect_error);
          return $con;
      }
  }
  </code></pre>
  
  <p>Then : </p>
  
  <pre><code>$con = new dbconnection();
  $db = $con -&gt; connect();
  </code></pre>
  
  <p>And here is the error message : </p>
  
  <pre><code>Warning: mysqli_connect(): php_network_getaddresses: getaddrinfo failed: unknown host. in C:\xampp\htdocs\hackaton\class\dbconnection.php on line 11
  
  Warning: mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: unknown host. in C:\xampp\htdocs\hackaton\class\dbconnection.php on line 11
  
  Notice: Trying to get property of non-object in C:\xampp\htdocs\hackaton\class\dbconnection.php on line 11
  Couldn't connect
  </code></pre>