php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3989 some joins fail to work properly
Submitted: 2000-03-30 19:12 UTC Modified: 2005-03-31 16:13 UTC
From: mattw at getacard dot com Assigned:
Status: Wont fix Package: ODBC related
PHP Version: 3.0.15 OS: Red Hat Linux 6.1
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mattw at getacard dot com
New email:
PHP Version: OS:

 

 [2000-03-30 19:12 UTC] mattw at getacard dot com
Using IBM DB2 for Linux, I ran the following query:

select A.name as alpha, B.name as bravo
from table1 A, table1 B, table2 C
where C.ref1 = A.id1 and C.ref2 = B.id2

Notice that table1 is pulled from twice, once as A and once as B. table2 (C) has two fields (ref1 and ref2) that each references one entry in table1.

Using odbc_fetch_into() (or, alternatively,
odbc_fetch_row()/odbc_fetch_result() ) causes the fields alpha and bravo to contain the same value. (Basically, the data that comes from table1 aliased as A is *also* set as the data from table1 aliased as B.)

In other words, if I pull the data into an associative array, the values 

$array["alpha"] 

and

$array["beta"]

return the same value, even if they are different in the database.  I tried pasting the query into the DB2 command line tool, and it works correctly (i.e. alpha and beta do not return the same value).

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-31 16:13 UTC] php-bugs at lists dot php dot net
We are sorry, but we do not support PHP 3 related problems anymore.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC