|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-11-05 00:43 UTC] jay at nicwr dot mah dot nic dot in
Description:
------------
I have IBM DB2 V 7.2 EE Fix Pack 7
My Php is enabled with ibm-db2 support
I have a table test (c1 int not null,c2 int,c3 int)
I have a unique key on table test as (c1) with include options for (c2,C3)
If I have a sample data
1,null,null
2,1,null,
3,null,1
4,1,2
If I access the data thru my php script I do not get desirable result.
Reproduce code:
---------------
<?php
$Conn=odbc_connect("dbname","db2admin","db2admin");
$sel="Select c1,c2,c3 from dbadmin.test";
$odbc_res=odbc_exec($Conn,$sel);
while(odbc_fetch_row($odbc_res))
{
echo "Record : ";
echo odbc_result($odbc_res,1);
echo "-";
echo odbc_result($odbc_res,2);
echo "-";
echo odbc_result($odbc_res,3);
echo "-End Record<br>";
}
?>
Expected result:
----------------
Expected Result is as follows
-----------------------------
Record:1---End Record
Record:2-1--End Record
Record:3--1-End Record
Record:4-1-2-End Record
Actual result:
--------------
Actual Results Appear as follows
--------------------------------
Record : ---End Record
Record : ---End Record
Record : ---End Record
Record : 4-1-2-End Record
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 03:00:02 2025 UTC |
Please upgrade first to PHP 4.3.4. And then try this script and paste the output here: <?php $Conn = odbc_connect("dbname","db2admin","db2admin"); $sel = "Select c1,c2,c3 from dbadmin.test"; $odbc_res = odbc_exec($Conn,$sel); while (odbc_fetch_row($odbc_res)) { var_dump(odbc_result($odbc_res,1)); var_dump(odbc_result($odbc_res,2)); var_dump(odbc_result($odbc_res,3)); } ?>