|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-10-21 13:32 UTC] dyohi at yahoo dot com
Description:
------------
Unable to return result set with long varchar. Excluding the long varchar column returns the result set fine. Am using DB2 Express-C 8.2.13, IIS, PHP 4.4.4, IBM_DB2.dll 1.5.1.
Table Structure
===============
id bigint
title varchar(100)
keywords varchar(100)
description varchar(1024)
Reproduce code:
---------------
$dbh = db2_connect($dbname, $username, $passwd, array('DB2_ATTR_CASE'=>DB2_CASE_LOWER));
$sql = "select * from mytable";
$resultres = db2_exec($dbh, $sql);
while($row = db2_fetch_assoc($resultres)){
$resultset[] = $row;
}
print_r($resultset);
db2_close($dbh);
Expected result:
----------------
array(
array[0]['id'] = 1,
array[0]['title'] = 'My Title',
array[0]['keywords'] = 'keyword1, keyword2',
array[0]['description'] = 'My Description...'
)
Actual result:
--------------
array()
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 16:00:01 2025 UTC |
Hi, I am not able to reproduce this bug. I have used the following script with the latest ibm_db2, PHP 5.1.6, DB2 Express C, and IIS: <?php $conn_string = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=mydatabase;HOSTNAME=myhostname;PORT=50000;PROTOCOL=tcpip;UID=myuser;PWD=*****;"; $conn = db2_connect($conn_string, '', '', array('DB2_ATTR_CASE'=>DB2_CASE_LOWER)); db2_exec($conn, "DROP TABLE test"); db2_exec($conn, "CREATE TABLE test (id BIGINT, title VARCHAR(100), keywords VARCHAR(100), description CLOB(1M))"); db2_exec($conn, "INSERT INTO test (id, title, keywords, description) values (1, 'My Title', 'keyword1, keyword2', 'My Description...')"); $sql = "select * from test"; $resultres = db2_exec($conn, $sql); while($row = db2_fetch_assoc($resultres)){ $resultset[] = $row; } print_r($resultset); db2_close($conn); ?> And the results are as follows: Array ( [0] => Array ( [id] => 1 [title] => My Title [keywords] => keyword1, keyword2 [description] => My Description... ) ) Can you try to update your PHP to the latest stable version (5.1.6), and try to reproduce? Please provide feedback after your PHP upgrade in order to either close this bug or continue debugging. Thank you.