#49846 [NEW]: function.odbc-field-name does not respect the AS function in a SELECT statement

From: Date: Mon, 12 Oct 2009 16:16:32 +0000
Subject: #49846 [NEW]: function.odbc-field-name does not respect the AS function in a SELECT statement
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2925@lists.php.net to get a copy of this message
From: kareemhamdy at gmail dot com Operating system: Ubuntu PHP version: 5.3.0 PHP Bug Type: Documentation problem Bug description: function.odbc-field-name does not respect the AS function in a SELECT statement Description: ------------ function.odbc-field-name does not respect the AS function in a SELECT statement shown below: $query_db_CDR = "SELECT tbl_EM_Matrix.hostname as vru from ..." The result, returns 'hostname', instead of 'vru'. Reproduce code: --------------- --- From manual page: function.odbc-field-name --- function odbc_fetch_assoc($result){ if (odbc_fetch_row($result)) { $return_array=array(); $max_result=odbc_num_fields($result); for ($counter=1;$counter<=$max_result;$counter++){ $return_array[odbc_field_name($result, $counter)] = odbc_result($result, $counter); } return $return_array; } } Expected result: ---------------- Using the select statement from above, I should be able to print_r (odbc_fetch_assoc($result)), and see 'vru'. Instead, I see 'hostname'. The function does not respect the "as" function. Array ([hostname]=>) Actual result: -------------- Array ([vru]=>) -- Edit bug report at http://bugs.php.net/?id=49846&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49846&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49846&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49846&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49846&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49846&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49846&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49846&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49846&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49846&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49846&r=support Expected behavior: http://bugs.php.net/fix.php?id=49846&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49846&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49846&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49846&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49846&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49846&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49846&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49846&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49846&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49846&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49846&r=mysqlcfg

« previous php.doc.bugs (#2925) next »