ID: 46533
Updated by: [EMAIL PROTECTED]
Reported By: taco at procurios dot nl
-Status: Open
+Status: Assigned
Bug Type: PDO related
Operating System: Linux
PHP Version: 5.2.6
-Assigned To:
+Assigned To: mysql
Previous Comments:
------------------------------------------------------------------------
[2008-11-10 10:09:12] taco at procurios dot nl
Description:
------------
When using aliases for tables and/or columns in a MySQL query. The
method PDOStatement::getColumnMeta() will not tell you anything about
the original table / column name. In the MySQLi extension the
information about the original table / column name was represented as
'orgtable' and 'orgname' this would be a very nice addition to the PDO
extension.
Reproduce code:
---------------
SQL:
CREATE TABLE `foobar` (
`bar` varchar(255) default NULL
) ENGINE=MEMORY;
PHP:
print_r(
$PDO->query("SELECT foo.bar as baz FROM foobar foo")
->getColumnMeta(0)
);
Expected result:
----------------
Array
(
[native_type] => VAR_STRING
[flags] => Array
(
)
[table] => foo
[orgtable] => foobar
[name] => baz
[orgname] => bar
[len] => 255
[precision] => 0
[pdo_type] => 2
)
Actual result:
--------------
Array
(
[native_type] => VAR_STRING
[flags] => Array
(
)
[table] => foo
[name] => baz
[len] => 255
[precision] => 0
[pdo_type] => 2
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46533&edit=1