title: Check if 'pdo->query foreach' return null
body: <p>The database is fine but i can't figure why $ROW cannot be recognized as NULL.</p>
  
  <p>I have this code:</p>
  
  <pre><code>$pdo = new PDO("mysql:host=" . $this-&gt;hostname . ";dbname=" . $this-&gt;dbname, $this-&gt;username, $this-&gt;password);
  
  foreach($pdo-&gt;query('SELECT * FROM people WHERE name="Joshua"') as $row):
      if($row['name'] != NULL):
          echo "WE HAVE ONE JOSHUA";
      else:
          echo "WE DO NOT HAVE ANY JOSHUA";
      endif;
  endforeach;
  </code></pre>
  
  <p>When i run this script i got the: "WE HAVE ONE JOSHUA" message;</p>
  
  <p>When i change name="Joshua" in PDO->QUERY for a name that does not exist on database i do not receive the "WE DO NOT HAVE ANY JOSHUA" message;</p>
  
  <p>Any hints to deal with this?</p>
  
  <p>I just want to create a statement that control if the FOREACH return NULL or NOT.</p>
  
  <p>Thanks in advance and sry the bad english.</p>