php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26130 IBM DB2 Unique Key Problem
Submitted: 2003-11-05 00:43 UTC Modified: 2003-11-25 15:32 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: jay at nicwr dot mah dot nic dot in Assigned:
Status: No Feedback Package: ODBC related
PHP Version: 4.3.4 OS: Linux 8.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
1 + 1 = ?
Subscribe to this entry?

 
 [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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-05 00:51 UTC] sniper@php.net
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));
  }
?>

 [2003-11-18 05:03 UTC] sniper@php.net
Please provide the requested feedback (see the code in my previous comment..)

 [2003-11-25 15:32 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Oct 31 20:01:24 2020 UTC