php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #56980 getColumnMeta() should also return all columns
Submitted: 2006-04-25 13:06 UTC Modified: 2006-04-29 21:56 UTC
From: phyre at rogers dot com Assigned:
Status: Wont fix Package: PDO (PECL)
PHP Version: 5_1 CVS-2006-04-25 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
41 - 23 = ?
Subscribe to this entry?

 
 [2006-04-25 13:06 UTC] phyre at rogers dot com
Description:
------------
PDOStatement::getColumnMeta() should allow a parameter (be it the same parameter as -1 or some other option) to return all columns.


Reproduce code:
---------------
$array = array();
for ($i = 0; $i < PDOStatement::columnCount(); $i++) {
  $array[] = PDOStatement::getColumnMeta($i);
}

could easily be replaced with a two-dimensional array that will return all columns.

The primary advantage would be avoiding $i function calls to getColumnMeta and $i to columnCount, which could be substantial versus returning the whole table meta data.

Returning a table's meta-data is nice to know the schema that's being returned.  A quick way to get the field names back.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-29 21:56 UTC] wez@php.net
You can do that yourself from a PHP script.
getColumnMeta is not a "fast" function anyway.
PS: don't use it; it may change, as described in the documentation.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 12:01:31 2024 UTC