PHP 5.1 is well on its way towards release, so very little time is left to sneak in forgotten or missing features into it. One very handy (IMHO) feature that I've added to the PDO MySQL driver is the ability to toggle usage of buffered queries.
Up until now any query executed would be unbuffered, which limited you to operation with just a single result cursor at a time. The only way to avoid this limitation was to use fetchALL() method to pre-fetch results into array and then use them. This however is not always possible or practical as I've found out in the progress of adding PDO support to FUDforum.
So, what do you do when something is lacking in PHP? Write a patch of course!
As of yesterday you can set PDO_MYSQL_ATTR_USE_BUFFERED_QUERY attribute to TRUE to enable buffered queries and FALSE to disable them.
PHP:
<?php
$a = new PDO($dsn, $login, $passwd);
$a->setAttribute(PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 1);
$res = $a->query("SELECT ...");
$a->setAttribute(PDO_MYSQL_ATTR_USE_BUFFERED_QUERY, 0);
foreach ($res as $v) {
$a->exec("UPDATE ...");
}
?>