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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Fri Dec 27 14:01:29 2024 UTC