From:             halla at laptopinformation dot com
Operating system: WinXP
PHP version:      5.0.2
PHP Bug Type:     Feature/Change Request
Bug description:  odbc_fetch_array function only return associative array

Description:
------------
Hello,

The other x_fetch_array functions you provide return an associative AND
numeric array.

We are are trying to port our code to odbc_fetch_array (from
sqlite_fetch_array and mysql_fetch_array) and the code has mixed numeric
and associative references.

Because of the mixture we cannot use the odbc_fetch_array function, as any
returned arrays that are dependent on numeric  arrays fail.

Why is this not a consistent function, and is there a workaround ?


Is there a way to have the fetch_array function return a $row array for
odbc with a numeric and associative index.


Reproduce code:
---------------
We have a class for each database called xxxxDatabase where xxxx = sqlite,
mysql or odbc.

This is the fetch_array function;

function fetch_array($result) {

$row = odbc_fetch_array($result);

return $row

}

This only returns an associative array.

function fetch_array($result) {

$row = mysql_fetch_array($result);

return $row

}

This return an associative and numeric array



Expected result:
----------------
To get an array that contains associative AND numeric indexes

Actual result:
--------------
Associative only - not consistent with other database fetch array
functions

-- 
Edit bug report at http://bugs.php.net/?id=30916&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30916&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=30916&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=30916&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30916&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30916&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30916&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30916&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30916&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30916&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30916&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=30916&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=30916&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30916&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30916&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30916&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30916&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30916&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30916&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30916&r=mysqlcfg

Reply via email to