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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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: Thu Apr 25 04:01:38 2024 UTC