title: I have connection to database in OOP php with PDO, then Connection send me a message
body: <pre><code>pdo)){ 
  try{ $link = new PDO("mysql:host=$this-&gt;host;dbname=$this-&gt;db;$this-&gt;username,$this-&gt;password"); 
  $link-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 
  }catch (PDOException $e){ 
     // report error message 
     echo $e-&gt;getMessage(); 
  } 
  }
   } 
  } 
  $db = new Database(); ?&gt;
  </code></pre>
  
  <blockquote>
    <p>SQLSTATE[HY000] [1044] Access denied for user ''@'localhost' to
    database 'crud'</p>
  </blockquote>