summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysql/mysql_result.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/mysql/mysql_result.php')
-rw-r--r--system/database/drivers/mysql/mysql_result.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php
index e540489bb..91c4af12c 100644
--- a/system/database/drivers/mysql/mysql_result.php
+++ b/system/database/drivers/mysql/mysql_result.php
@@ -53,6 +53,27 @@ class CI_DB_mysql_result extends CI_DB_result {
// --------------------------------------------------------------------
/**
+ * Fetch Field Names
+ *
+ * Generates an array of column names
+ *
+ * @access public
+ * @return array
+ */
+ function field_names()
+ {
+ $field_names = array();
+ while ($field = mysql_fetch_field($this->result_id))
+ {
+ $field_names[] = $field->name;
+ }
+
+ return $field_names;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Field data
*
* Generates an array of objects containing field meta-data