ID: 25081
Comment by: gms08701 at yahoo dot com
Reported By: jojoao at hotmail dot com
Status: Closed
Bug Type: ODBC related
Operating System: Windows 2000
PHP Version: 4.3.3RC3
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2003-08-15 07:05:31] [EMAIL PROTECTED]
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2003-08-13 16:17:52] 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"
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25081&edit=1