What should print_r with a PDO statement in PHP return?
<pre><code>$dbh = new PDO ("sqlite:/Library/WebServer/Documents/nwind2009.db3");
$sql = "SELECT * FROM Customers";     
print_r($dbh-&gt;query($sql));
</code></pre>

<p>This returns:</p>

<p>PDOStatement Object ( [queryString] => SELECT * FROM Customers )</p>

<p>but if I do:</p>

<pre><code> foreach ($dbh-&gt;query($sql) as $row) {
    echo $row['CompanyName'];
 }
</code></pre>

<p>I get the data.</p>

<p>Why doesn't print_r show the database results?  What special thing is happening in the foreach?  I thought print_r showed me the array and that that was what I was doing in my foreach.</p>

<p>Thanks.</p>
