From 194b894c33eb812f84862b53691eb5de304455bb Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 4 Oct 2006 07:59:32 +0000 Subject: --- user_guide/database/fields.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'user_guide/database') diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 83abe6327..f3ba357d5 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -65,14 +65,14 @@ Field Names

Field Data

-

$this->db->list_fields();

+

$this->db->list_fields()

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:

-$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)
-

$this->db->field_exists();

+

$this->db->field_exists()

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'))
-

$this->db->field_data();

+

$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.

@@ -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