Posted by Toby A Inkster on 03/30/07 12:22
bill wrote:
> One additional question: does the foreach loop terminate because
> the query return false ?
It terminates as soon as the query has run out of rows.
It's a PHP 5 feature called "Iterators" -- that is PDO queries are
returned as objects that, although they are not arrays, can be treated as
arrays in a foreach loop. The solution would work equally well using PHP 4
constructs, but the code doesn't look as neat.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
[Back to original message]
|