From 48d8388359353093e272756e7756c629b2cf71e2 Mon Sep 17 00:00:00 2001
From: Derek Allard 1. You can supply the table name and call it from the $this->db-> object:
-$fields = $this->db->list_fields('table_name')
+$fields = $this->db->list_fields('table_name');
foreach ($fields as $field)
{
@@ -79,7 +79,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)
@@ -105,8 +105,6 @@ if ($this->db->field_exists('field_name', 'table_name'))
table_name with the name of the table you are looking for.
-
-
$this->db->field_data()
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.
@@ -117,7 +115,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)
{
@@ -131,8 +129,8 @@ foreach ($fields as $field)
If you have run a query already you can use the result object 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();
@@ -144,9 +142,6 @@ $fields = $query->field_data()
primary_key - 1 if the column is a primary key
type - the type of the column
-
-
-
--
cgit v1.2.3-24-g4f1b