title: Fatal error: Uncaught exception 'PDOException' with message 'could not find driver'
body: <p>I'm new to web development and today, just as I was practicing with a local server (using XAMPP Apache and MySQL services), I got this error message:</p>
  
  <pre><code> Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in C:\xampp\htdocs\blog\resources\query functions.php:3 Stack trace: #0 C:\xampp\htdocs\blog\resources\query functions.php(3): PDO-&gt;__construct('dblib:host=loca...', 'admin', 'root') #1 C:\xampp\htdocs\blog\resources\main.php(23): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\blog\resources\query functions.php on line 3
  </code></pre>
  
  <p>There's index.php file in <code>C:\xampp\htdocs\blog that includes main.php</code> from <code>C:\xampp\htdocs\blog\resources</code>, then main.php includes another file in same directory called <code>queryfunctions.php</code>. main.php only has one line of code and that is to include <code>queryfunctions.php</code>. Then in that file I wrote this:</p>
  
  <pre><code>$database = new PDO('dblib:host=localhost;dbname=test;charset=UTF-8', "admin", "root");
  </code></pre>
  
  <p>And then it gives me the error whenever I go to test it. I've read through a couple of questions and answers already, but none helped. In my PHP info, these are the PDO drivers installed: <code>mysql, odbc, sqlite, sqlite2</code>. </p>
  
  <blockquote>
    <p>PDO Driver for MySQL: Client API Version mysqlnd 5.0.8-dev - 20102224
    - $Revision: 310735 $.</p>
  </blockquote>