|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-02 19:38 UTC] frederic dot fanchamps at skynet dot be
[2006-11-13 15:09 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 01:00:01 2025 UTC |
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