|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-08-13 16:17 UTC] jojoao at hotmail dot com
Description:
------------
It seems like odbc_fetch_array doesn't return numeric fields propely like others *_fetch_array does. This may cause alot of trouble.
Reproduce code:
---------------
$re = odbc_exec($id_mssql,"select 99 as first,100,101");
$row=odbc_fetch_array($re);
var_dump($row);
Expected result:
----------------
array(6) {
[0]=>
string(2) "99"
["first"]=>
string(2) "99"
[1]=>
string(3) "100"
[100]=>
string(3) "100"
[2]=>
string(3) "101"
[101]=>
string(3) "101"
}
Actual result:
--------------
array(2) {
["first"]=>
string(2) "99"
[""]=>
string(3) "101"
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 20:00:01 2025 UTC |
According to the manual, it states, "Fetch a result row as an associative array". So is it supposed to also return numerical arrays like the other *_fetch_array() functions do? I just tried Version 4.3.3RC5-dev (Aug 20 2003 22:11:08) from snaps, and it still is returning just an associative array. $sql = 'SELECT versionnumber FROM sysibm.sysversions FOR READ ONLY'; $result = odbc_result($conn, $sql); var_dump(odbc_fetch_array($result)); produces: array(1) { ["VERSIONNUMBER"]=> string(7) "8010300" } This isn't meant to open back the bug. Im not sure if the function is supposed to return an associative array only, or an associative/numeric array.