From ab4f61bacfa022c0c7238e9661ad9cb2ac440d95 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 25 Sep 2006 22:12:32 +0000 Subject: --- user_guide/database/fields.html | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'user_guide') diff --git a/user_guide/database/fields.html b/user_guide/database/fields.html index 7cf1f9c4e..ecb6fcb45 100644 --- a/user_guide/database/fields.html +++ b/user_guide/database/fields.html @@ -66,10 +66,13 @@ Field Names

Retrieving Field Names

-

Sometimes it's helpful to gather the field names.

+

Sometimes it's helpful to gather the field names for a particular table or with a paritcular query result.

$this->db->field_names();

-

Returns an array containing the field names. You must supply the table name to the function:

+

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->field_names('table_name');

@@ -80,6 +83,21 @@ foreach ($fields as $field)
}
+

2. You can gather the feild names associated with any query you run by calling the function +from your query result object:

+ + +$query = $this->db->query('SELECT * FROM some_table'); +

+ +foreach ($query->field_names() as $field)
+{
+   echo $field;
+} +
+ + +

Retrieving Field MetaData

-- cgit v1.2.3-24-g4f1b