title: PDO: Could not find driver php/mysql
body: <p>i'm having issues connecting to my database on a web host that I have, i'm using the following:</p>
  
  <pre><code>$dsn = 'mysql:host=mysql1.hosting.digiweb.ie;dbname=mydbname';
   $user = 'myusername';
   $password = 'mypassword';
  </code></pre>
  
  <p>According to the website: Host Name mysql1.hosting.digiweb.ie (ip address) </p>
  
  <p>as the title says i'm getting a could not find driver error, am i entering the host incorrectly i tried entering whats above and also the ip address - Thanks!</p>
  
  <p>Edit:</p>
  
  <p>Here's all my code</p>
  
  <pre><code>&lt;?php
  
   $dsn = 'mysql:host=localhost;dbname=';
   $user = '';
   $password = '';
  
  try {
    // Connect and create the PDO object
   $dbh = new PDO($dsn, $user, $password);
   $dbh-&gt;setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
  }
  catch(PDOException $e) {
   echo 'Database connection failed - ';
   echo $e-&gt;getMessage();
   exit;
  }
  
  
  echo 'works';
  ?&gt;
  </code></pre>