title: PHP-PDO: Display all rows
body: <p>I'm doing var_dump since I started to learn PHP/PDO when I want to display the SQL datas, like:</p>
  
  <pre><code>$tickets = $db-&gt;query('SELECT * FROM tickets')-&gt;fetchAll();
  var_dump($tickets);
  </code></pre>
  
  <p>And it shows everything.</p>
  
  <p>But now I'd like to <code>echo</code> a list of all <strong>tickets name</strong>, usually I would do an <code>echo $tickets-&gt;name;</code> but first it doesn't work with fetchAll(); and when I use fetch(); it returns only the last row</p>
  
  <p>Noob question but all the answers I get are outdated and uses depreciated mysql, how can I just display the rows with PDO ?</p>
  
  <p>Thanks !</p>