title: Connection using PDO
body: <p>Just started working with PDO.Please explain me the error in my connectivity.It always shows "You are connected".</p>
  
  <pre><code>    &lt;?php
  
         define('user','root');
         define('pass','');
         define('db','login_db');
  
         try
            {
         $dbh = new PDO("mysql:host = localhost; dbname = db",user,pass);
         echo "You are connected";
            }
         catch(PDOException $e)
            {
         echo $e -&gt; getMessage(); 
            }
      ?&gt;
  </code></pre>
  
  <p>Also provide with some tutorial or ebook for PDO you aware with. Thanks in advance.</p>