Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Trivial Trivial
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Drivers
    • Labels:
      None

      Description

      It would be nice to have a utility method in \Doctrine\Dbal\Driver\ResultStatement to properly retrieve the result column names.

      Currently, we have to rely on somthing like
      $columnNames = array_keys($statement->fetch(\PDO::FETCH_ASSOC));

      Problem: It does not work with empty result-sets, and more checks should be performed to handle these.

      With PDO, http://www.php.net/manual/en/pdostatement.getcolumnmeta.php could be used to properly retrieve names.

      For Sqlite3 it is easy, http://www.php.net/manual/en/sqlite3result.columnname.php

      For Mysql, http://www.php.net/manual/en/mysqli-result.fetch-fields.php would do the trick

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Benoît Burnichon
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: