Bug #3989: some joins fail to work properly

From: Date: Fri, 31 Mar 2000 00:12:08 +0000
Subject: Bug #3989: some joins fail to work properly
Groups: php.dev 
Request: Send a blank email to php-dev+get-17442@lists.php.net to get a copy of this message
From: mattw@getacard.com Operating system: Red Hat Linux 6.1 PHP version: 3.0.15 PHP Bug Type: ODBC related Bug description: some joins fail to work properly 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).

« previous php.dev (#17442) next »