php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69498 odbc_fetch_array returns field values in array keys
Submitted: 2015-04-21 13:40 UTC Modified: 2015-05-27 14:17 UTC
Votes:5
Avg. Score:5.0 ± 0.0
Reproduced:5 of 5 (100.0%)
Same Version:5 (100.0%)
Same OS:5 (100.0%)
From: asears at conestogawood dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 5.5.24 OS: Linux (Gentoo Base 2.2/Kernel 4)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: asears at conestogawood dot com
New email:
PHP Version: OS:

 

 [2015-04-21 13:40 UTC] asears at conestogawood dot com
Description:
------------
Using PHP-5.5.24, unixODBC 2.3.2, IBM iSeriesAccess 1.1.0.2
odbc_fetch_array returns the field values as the array keys instead of the column names as expected.

Test script:
---------------
$odbc = odbc_connect('AS400', '', '');
$result = odbc_exec($odbc, "SELECT * FROM SYSIBM.SYSCHARSETS");
var_dump(odbc_fetch_array($result));


Expected result:
----------------
(result using PHP-5.5.23)
array(4) {
  ["CHARACTER_SET_SCHEMA"]=>
  string(18) "INFORMATION_SCHEMA"
  ["CHARACTER_SET_NAME"]=>
  string(8) "SQL_TEXT"
  ["DEFAULT_COLLATE_SCHEMA"]=>
  string(18) "INFORMATION_SCHEMA"
  ["DEFAULT_COLLATE_NAME"]=>
  string(8) "SQL_TEXT"
}


Actual result:
--------------
(result using PHP-5.5.24)
array(2) {
  ["INFORMATION_SCHEMA"]=>
  string(18) "INFORMATION_SCHEMA"
  ["SQL_TEXT"]=>
  string(8) "SQL_TEXT"
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-22 18:51 UTC] theodoreb at goshen dot edu
Any updates on this bug? The function works as expected on PHP-5.4.32, unixODBC-2.3.2, SQL Server 2008R2 SP1, Gentoo Linux. So looks like PHP-5.5.x is the culprit.
 [2015-05-27 14:16 UTC] asears at conestogawood dot com
Appears to have been fixed in PHP-5.5.25.
 [2015-05-27 14:17 UTC] asears at conestogawood dot com
-Status: Open +Status: Closed
 [2015-05-27 14:17 UTC] asears at conestogawood dot com
Fixed in PHP 5.5.25.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 19:01:37 2025 UTC