|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-12-09 08:19 UTC] tuomaksen dot spammiposti at gmail dot com
[2008-12-12 04:47 UTC] tuomaksen dot spammiposti at gmail dot com
[2008-12-15 02:15 UTC] abhargav at in dot ibm dot com
[2008-12-15 05:16 UTC] tuomaksen dot spammiposti at gmail dot com
[2008-12-15 05:18 UTC] abhargav at in dot ibm dot com
[2009-03-02 06:14 UTC] abhargav at in dot ibm dot com
[2009-03-02 06:36 UTC] tuomaksen dot spammiposti at gmail dot com
[2009-03-02 07:17 UTC] abhargav at in dot ibm dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 15:00:01 2025 UTC |
Description: ------------ I noticed a strange behaviour in fetching data from DB2 databases. With PDO_IBM some fields (type of VARLEN(?)) are returned as blank or in some case the field contents seem to be a text "Resource id #<num>" while in reality they contain text. Otherwise the query returns the correct data. Using the db2_* -functions on the fields are returned ok. Reproduce code: --------------- <?php /** Does not work **/ $db = new PDO($dsn,$user,$pass); $result = $db->query('SELECT * FROM table'); $matrix = $result->fetchAll(PDO::FETCH_ASSOC); echo "<table>\n"; foreach($matrix as $row) { echo "<tr>\n"; foreach($row as $cell) { echo "<td>$cell</td>\n"; } echo "</tr>\n"; } echo "</table>\n"; /** This seems to work **/ $conn = db2_connect($db,$user,$pass); $prep = db2_prepare($conn,'SELECT * FROM table'); db2_execute($prep); while($row = db2_fetch_assoc($prep) { echo "<tr>\n"; foreach($row as $item) { echo "<td>$item</td>\n"; } echo "</tr>\n"; } ?> Expected result: ---------------- Fields type of VARLEN(?) should contain data. Actual result: -------------- Field is returned as empty or in some cases field contains text "Resource id #<num>". Other fields are displayed correctly.