title: Error connecting to mysql database.
body: <p>It might be a duplicate, but i went through all the solution that are suggested in other posts at stackoverflow but cannot find a solution.</p>
  
  <pre><code> &lt;?php
  $PDO= new PDO('mysql:host= 127.0.0.1; dbname = social_network; charset= utf8', 'root', '' );
  $PDO-&gt; setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  
  ?&gt;
  </code></pre>
  
  <p>The error i am having is as follows: </p>
  
  <p>Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2019] Unknown character set in C:\xampp\htdocs\social_network\create_account.php:2 Stack trace: #0 C:\xampp\htdocs\social_network\create_account.php(2): PDO->__construct('mysql:host= 127...', 'root', '') #1 {main} thrown in C:\xampp\htdocs\social_network\create_account.php on line 2</p>
  
  <p>I appreciate your quick asnwer.</p>