|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-11 10:48 UTC] kfbombar at us dot ibm dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 13:00:02 2025 UTC |
Description: ------------ I found the following piece of code not working correctly. It was run on SuSE Linux 32 connecting to a DB2 database. It was run with PHP 5.1.2, and the pdo_odbc 1.0. This same issue causes an error in ext/pdo/tests/pdo_021.phpt. Please let me know if you need any further information. Reproduce code: --------------- <? $conn = new PDO('odbc:nodename', 'user', 'pass'); $conn->exec('DROP TABLE test'); $conn->exec('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, val0 VARCHAR(10), val1 VARCHAR(16))'); $select = $conn->prepare('SELECT COUNT(id) FROM test'); $data = array( array('0', 'Aa', 'aA'), array('1', 'Bb', 'bB'), ); $stmt = $conn->prepare("INSERT INTO test VALUES(?, ?, ?)"); foreach ($data as $row) { $stmt->execute($row); } $select->execute(); $num = $select->fetchColumn(); echo 'There are ' . $num . " rows in the table.\n"; ?> Expected result: ---------------- There are 2 rows in the table. Actual result: -------------- There are 0 rows in the table.