title: Can't connect to database with pdo
body: <p>This is my code to connect to a database.</p>
  
  <pre><code>$host = 'http://databases.000webhost.com/';
      $dbname = 'myDb';
      $username = 'root';
      $password = 'myPsw';
  
    try {
  
      $conn = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
  
      echo "Connecté à $dbname sur $host avec succès.";
  
    } catch (PDOException $e) {
  
      die("Impossible de se connecter à la base de données $dbname :" . $e-&gt;getMessage());
  
    }
  </code></pre>
  
  <p>I followed this tutorial: <a href="https://waytolearnx.com/2019/10/connexion-a-une-base-de-donnees-mysql-avec-php-pdo.html" rel="nofollow noreferrer">https://waytolearnx.com/2019/10/connexion-a-une-base-de-donnees-mysql-avec-php-pdo.html</a></p>
  
  <p>And here is the error that comes up.</p>
  
  <blockquote>
    <p>Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Failed to parse address “<a href="http://databases.000webhost.com" rel="nofollow noreferrer">http://databases.000webhost.com</a></p>
  </blockquote>