From 194b894c33eb812f84862b53691eb5de304455bb Mon Sep 17 00:00:00 2001
From: admin Returns an array containing the field names. This query can be called two ways: 1. You can supply the table name and call it from the $this->db-> object:Field Data
-$this->db->list_fields();
+$this->db->list_fields()
-$fields = $this->db->list_fields('table_name');
+$fields = $this->db->list_fields('table_name')
foreach ($fields as $field)
{
@@ -84,7 +84,7 @@ foreach ($fields as $field)
from your query result object:
-$query = $this->db->query('SELECT * FROM some_table');
+$query = $this->db->query('SELECT * FROM some_table')
foreach ($query->list_fields() as $field)
@@ -94,7 +94,7 @@ foreach ($query->list_fields() as $field)
-Sometimes it's helpful to know whether a particular field exists befor performing an action. Returns a boolean TRUE/FALSE. Usage example:
@@ -112,7 +112,7 @@ if ($this->db->field_exists('field_name', 'table_name'))Returns an array of objects containing field information.
Sometimes it's helpful to gather the field names or other metadata, like the column type, max length, etc.
@@ -122,7 +122,7 @@ if ($this->db->field_exists('field_name', 'table_name'))Usage example:
-$fields = $this->db->field_data('table_name');
+$fields = $this->db->field_data('table_name')
foreach ($fields as $field)
{
@@ -136,8 +136,8 @@ foreach ($fields as $field)
If you have run a query already you can use the result oject instead of supplying the table name:
-$query = $this->db->query("YOUR QUERY");
-$fields = $query->field_data();
+$query = $this->db->query("YOUR QUERY")
+$fields = $query->field_data()
--
cgit v1.2.3-24-g4f1b