#49846 [Opn->Bgs]: function.odbc-field-name does not respect the AS function in a SELECT statement
| From: | vrana@php.net | Date: | Fri, 13 Nov 2009 21:01:10 +0000 |
| Subject: | #49846 [Opn->Bgs]: function.odbc-field-name does not respect the AS function in a SELECT statement | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3131@lists.php.net to get a copy of this message | ||
ID: 49846
Updated by: vrana@php.net
Reported By: kareemhamdy at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
Operating System: Ubuntu
PHP Version: 5.3.0
New Comment:
The description clearly states that the function returns columnname,
not the alias.
Previous Comments:
------------------------------------------------------------------------
[2009-10-12 16:16:32] kareemhamdy at gmail dot com
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 this bug report at http://bugs.php.net/?id=49846&edit=1