title: PDO Invalid argument supplied for foreach()
body: <p>If you guys could please help,
  im trying to switch to the new PDO but having a hard time...</p>
  
  <p>Why does this code work:</p>
  
  <pre><code>include ('connect.php');
  
  $sql = "SELECT * FROM GP_2012";
  $conn = $DBH-&gt;query($sql);
  
  foreach ($conn as $row)
      {
      print $row['Prenom'] . ' ' . $row['Nom'] . '&lt;br&gt;' . 
      'Type: ' . $row['Type'] . '&lt;br&gt;' . 
      'Telephone: ' . $row['Tel'] . '&lt;br&gt;' .
      'Mail: ' . $row['Mail'] . '&lt;br&gt;' .
      'Bateau: ' . $row['Bateau'] . '&lt;br&gt;' .
      '&lt;br&gt;&lt;br&gt;';
      }
  </code></pre>
  
  <p>.</p>
  
  <p>And not this one:</p>
  
  <pre><code>include ('connect.php');
  
  $sql = "SELECT * FROM GP_2012 WHERE Nom LIKE Pageot";
  $conn = $DBH-&gt;query($sql);
  
  foreach ($conn as $row)
      {
      print $row['Prenom'] . ' ' . $row['Nom'] . '&lt;br&gt;' . 
      'Type: ' . $row['Type'] . '&lt;br&gt;' . 
      'Telephone: ' . $row['Tel'] . '&lt;br&gt;' .
      'Mail: ' . $row['Mail'] . '&lt;br&gt;' .
      'Bateau: ' . $row['Bateau'] . '&lt;br&gt;' .
      '&lt;br&gt;&lt;br&gt;';
      }
  </code></pre>
  
  <p>I tried in PHPMYADMIN and those queries both work, the second one should show one result but instead i get nothing and in my error log i get:
  Invalid argument supplied for foreach()</p>