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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phyre at rogers dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Thu Dec 26 23:01:28 2024 UTC