php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57113 returned result incomplete
Submitted: 2006-06-27 17:48 UTC Modified: 2013-02-18 00:35 UTC
From: jordan at ithinc dot net Assigned:
Status: No Feedback Package: PDO_ODBC (PECL)
PHP Version: 5.1.2 OS: Windows XP
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:
41 + 43 = ?
Subscribe to this entry?

 
 [2006-06-27 17:48 UTC] jordan at ithinc dot net
Description:
------------
I'm tring to get information from an access database using a join of 2 tables. The columns used in the join condition is returned by PHP incorrectly. On small datasets everything works fine. For larger datasets the bug always occurs. 

I have already compacted/repaired the database, this is not the problem. The query works fine in actual access database.

for now fetching by column number will work but fetching associative does not

Thanks,
Jordan

Note: This bug is on PHP 5.1.4, for some reason I can't select a 5.1.4 version in the dropdown. 

Reproduce code:
---------------
$dsn = "odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\\test.mdb";
$DB = new PDO($dsn, null, null);
$SQL = "SELECT * FROM A inner JOIN B ON A.AID = B.AID;";
$res = $DB->query($SQL);
foreach($res->fetchAll(PDO::FETCH_ASSOC) as $row)
	print_r($row);



Expected result:
----------------
Array
(
    [AID] => 1
    [INFO] => info
    [BID] => 2
    [DATA] => data
)
...etc...

Actual result:
--------------
Array
(
    [AID] => 
    [INFO] => info
    [BID] => 2
    [DATA] => data
)
...etc...
none of the returned arrays contain AID

if $res->fetchAll() is used we instead get the following:

Array
(
    [AID] =>
    [0] => 1
    [INFO] => info
    [1] => info
    [BID] => 2
    [2] => 2
    [3] => 1
    [DATA] => data
    [4] => data
)
...etc...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-10 22:20 UTC] wez@php.net
Please try the next stable 5.2 snapshot from snaps.php.net.
It's not clear from your report, but I think the issue you had was that you'd lose the data for columns after the last "long" column in your dataset.
If that is correct, then the next snapshot (or PHP 5.2) is what you're waiting for.
 [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot 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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 08:01:28 2024 UTC