ID: 39345
User updated by: frederic dot fanchamps at skynet dot be
Reported By: frederic dot fanchamps at skynet dot be
Status: Open
Bug Type: ODBC related
Operating System: Windows XP
PHP Version: 5.1.6
New Comment:
I have tried with PHP 5.2.1-dev (cli) (built: Oct 31 2006 08:22:42) and
with this version the problem does not occur.
Previous Comments:
------------------------------------------------------------------------
[2006-11-02 16:12:56] frederic dot fanchamps at skynet dot be
Description:
------------
foreach($query as $row), $query coming from PDO, gives PDO exception at
ext\pdo_odbc\odbc_stmt.c:363 after reading the last row
Reproduce code:
---------------
<?php
$d = new PDO('odbc:localdb2', 'frf', 'password');
$d->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
foreach ($d->query('select * from employee') as $row) {
/* some code, or not, does not matter */
}
?>
Expected result:
----------------
no exception in the foreach
Actual result:
--------------
After reading the last row,
PHP Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[]: <<Unknown error>>: 0 (SQLFetchScroll[0] at
ext\pdo_odbc\odbc_stmt.c:363)' in C:\_work\test.php:5
Stack trace:
#0 C:\_work\test.php(5): unknown()
#1 {main}
thrown in C:\_work\test.php on line 5
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39345&edit=1