diff options
-rw-r--r-- | system/database/drivers/pdo/pdo_result.php | 8 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/system/database/drivers/pdo/pdo_result.php b/system/database/drivers/pdo/pdo_result.php index 0b8937cc5..867105605 100644 --- a/system/database/drivers/pdo/pdo_result.php +++ b/system/database/drivers/pdo/pdo_result.php @@ -124,12 +124,14 @@ class CI_DB_pdo_result extends CI_DB_result { */ public function list_fields() { - if ($this->db->db_debug) + $field_names = array(); + for ($i = 0, $c = $this->num_fields(); $i < $c; $i++) { - return $this->db->display_error('db_unsuported_feature'); + $field_names[$i] = @$this->result_id->getColumnMeta(); + $field_names[$i] = $field_names[$i]['name']; } - return FALSE; + return $field_names; } // -------------------------------------------------------------------- diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index f69ce5c15..e5c46ff93 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -136,6 +136,7 @@ Release Date: Not Released - Added ODBC support for create_database(), drop_database() and drop_table() in :doc:`Database Forge <database/forge>`. - Added PDO support for create_database(), drop_database and drop_table() in :doc:`Database Forge <database/forge>`. - Added unbuffered_row() method for getting a row without prefetching whole result (consume less memory). + - Added PDO support for ``list_fields()`` in :doc:`Database Results <database/results>`. - Libraries |