From dd6719738936be31cdaa1758ca86d5eb14dcab3d Mon Sep 17 00:00:00 2001 From: Barry Mieny Date: Mon, 4 Oct 2010 16:33:58 +0200 Subject: Cleanup of stray spaces and tabs --- user_guide/database/results.html | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'user_guide/database/results.html') diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 9eaa1793e..410dac840 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -65,11 +65,11 @@ Query Results

There are several ways to generate query results:

result()

- +

This function returns the query result as an array of objects, or an empty array on failure. - + Typically you'll use this in a foreach loop, like this:

- + $query = $this->db->query("YOUR QUERY");

@@ -79,11 +79,11 @@ Query Results    echo $row->name;
   echo $row->body;
}
- +

The above function is an alias of result_object().

If you run queries that might not produce a result, you are encouraged to test the result first:

- + $query = $this->db->query("YOUR QUERY");

@@ -97,9 +97,9 @@ Query Results    }
}
- +

result_array()

- +

This function returns the query result as a pure array, or an empty array when no result is produced. Typically you'll use this in a foreach loop, like this:

$query = $this->db->query("YOUR QUERY");
@@ -113,7 +113,7 @@ Query Results

row()

- +

This function returns a single result row. If your query has more than one row, it returns only the first row. The result is returned as an object. Here's a usage example:

@@ -128,9 +128,9 @@ Query Results    echo $row->body;
}
- +

If you want a specific row returned you can submit the row number as a digit in the first parameter:

- + $row = $query->row(5); @@ -151,13 +151,13 @@ Query Results }
- +

If you want a specific row returned you can submit the row number as a digit in the first parameter:

- + $row = $query->row_array(5); - -

In addition, you can walk forward/backwards/first/last through your results using these variations:

+ +

In addition, you can walk forward/backwards/first/last through your results using these variations:

$row = $query->first_row()
@@ -217,7 +217,7 @@ $query2->free_result(); // The $query2 result object will no longer be availabl - + -- cgit v1.2.3-24-g4f1b