title: How to output data when using $stmt->fetch(PDO::FETCH_ASSOC);
body: <p>How do you correctly output data when using <code>$stmt-&gt;fetch(PDO::FETCH_ASSOC)</code>? Right now I'm getting single words as my result when doing</p>
  
  <pre><code>"select name, author, title from d_books"
  
  // Other PDO stuff goes here
  $arr = $stmt-&gt;fetch(PDO::FETCH_ASSOC);
  foreach ($arr as $titleData) {
     echo $titleData['name'];
  }
  </code></pre>