From 5808346898ec9c602893fc54540958a8c556be29 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 24 Sep 2006 17:58:27 +0000 Subject: --- user_guide/libraries/database/results.html | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'user_guide/libraries/database/results.html') diff --git a/user_guide/libraries/database/results.html b/user_guide/libraries/database/results.html index 342e7e4b4..b1952db5a 100644 --- a/user_guide/libraries/database/results.html +++ b/user_guide/libraries/database/results.html @@ -100,7 +100,7 @@ Query Results    }
} - +

result_array()

This function returns the query result as a pure array, or FALSE on failure. Typically you'll use this in a foreach loop, like this:

@@ -114,6 +114,10 @@ Query Results    echo $row['body'];
} +

result('array')

+ +

Identical to $this->db->result_array().

+

row()

@@ -180,6 +184,25 @@ Query Results +


Result Helper Functions

+ + +

$query->num_rows()

+

The number of rows returned by the query. Note: In this example, $query is the variable that the query result object is assigned to:

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

+echo $query->num_rows(); +
+ +

$query->num_fields()

+

The number of FIELDS (columns) returned by the query. Make sure to call the function using your query result object:

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

+echo $query->num_fields(); +
+ + + @@ -192,7 +215,7 @@ Previous Topic:  Queries    ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Active Record Pattern +Next Topic:  Query Helper Functions

Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

-- cgit v1.2.3-24-g4f1b