TrunseEveve
New Member
I am confused about this, I run a query such as \[code\]foreach($dbh->query("SELECT * FROM ...") as $row) { ...do something with row()\[/code\]But when I var_dump \[code\]$dbh\[/code\] it is a PDOstatement object.This leads me to two questions:
- How does foreach somehow resolve the object into separate rows?
- How can I store all rows in an array, like $arr = $dbh->query(...)? This does not work because it is still an object