PHP $db PDO connection error
<p>I wanted to make posts and comments system.<br>
Posts worked fine, but comments had </p>

<blockquote>
  <p>PHP error: Fatal error: Uncaught exception 'PDOException' with message 'invalid data source name' in C:\xampp\htdocs\index.php:133 Stack trace: #0 C:\xampp\htdocs\index.php(133): PDO->__construct('localhost', 'root', '') #1 {main} thrown in C:\xampp\htdocs\index.php on line 133. `
</blockquote>

<pre><code>$db = new PDO ("localhost", "root", "");
$query = $db-&gt;prepare("SELECT * FROM comments");
$query-&gt;execute();
while($fetch = $query-&gt;fetch(PDO::FETCH_ASSOC)){
    $name = $fetch['name'];
    $message = $fetch['comment'];
    echo "&lt;li class='com'&gt;&lt;b&gt;".ucwords($name)."&lt;/b&gt; - ".$message."&lt;/li&gt;";
}
</code></pre>

<p>It's element of table. Please help.</p>