|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-11-17 17:32 UTC] johannes@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 11:00:01 2025 UTC |
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 )