summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-07-04 21:38:52 +0200
committerAndrey Andreev <narf@bofh.bg>2012-07-04 21:38:52 +0200
commit626f1a657206a8b33a59c20388d0ec4de4593487 (patch)
tree03a5bbff5f7a22c703d007eb05e020b8ffa46876 /system/database/drivers/pdo
parent36d1ac94a8b55485db30677a72bc3d57c3bb3cf8 (diff)
Add PDO support for list_fields()
Signed-off-by: Andrey Andreev <narf@bofh.bg>
Diffstat (limited to 'system/database/drivers/pdo')
-rw-r--r--system/database/drivers/pdo/pdo_result.php8
1 files changed, 5 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;
}
// --------------------------------------------------------------------