From ca06da4b58aa38617ee8bb2f4c4d5c6a58e59db0 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sat, 19 Jan 2008 17:55:42 +0000 Subject: guide fixes, remove 1.5.5 update file --- user_guide/database/active_record.html | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'user_guide/database') diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 696b71171..4ba5bfd96 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -311,7 +311,7 @@ $this->db->or_where('id >', $id);

Generates a WHERE field IN ('item', 'item') SQL query joined with OR if appropriate

$names = array('Frank', 'Todd', 'James');
- $this->db->where_in_or('username', $names);
+ $this->db->or_where_in('username', $names);
// Produces: OR WHERE username IN ('Frank', 'Todd', 'James')

$this->db->where_not_in();

@@ -325,22 +325,9 @@ $this->db->or_where('id >', $id);

Generates a WHERE field NOT IN ('item', 'item') SQL query joined with OR if appropriate

$names = array('Frank', 'Todd', 'James');
- $this->db->where_in('username', $names);
+ $this->db->or_where_not_in('username', $names);
// Produces: OR WHERE username NOT IN ('Frank', 'Todd', 'James')

-

$this->db->raw_where();

-

Generates an unfiltered WHERE portion of the query exactly as the developer passes it. Separates multiple calls with AND
- $this->db->raw_where('(grade > 50 AND grade < 75)');
- // Produces: AND WHERE (grade > 50 AND grade < 75)

- -

$this->db->raw_or_where();

-

Generates an unfiltered WHERE portion of the query exactly as the developer passes it. Separates multiple calls with OR
- $this->db->raw_where('(grade > 50 AND grade < 75)');
- // Produces: OR WHERE (grade > 50 AND grade < 75)

- -

Note: All values passed through raw_where() and raw_or_where() are not escaped automatically, or otherwise touched. It is the responsibility of the developer to ensure all queries are safe. Consider using protect_identifiers() and escaping your queries as appropriate.

- -

$this->db->like();

This function enables you to generate LIKE clauses, useful for doing searches.

@@ -403,7 +390,7 @@ $this->db->or_like('body', $match); $this->db->like('title', 'match');
$this->db->or_not_like('body', 'match');

-// WHERE title LIKE '%match% OR body NOT LIKE 'match'
+// WHERE title LIKE '%match% OR body NOT LIKE '%match%'

$this->db->group_by();

Permits you to write the GROUP BY portion of your query:

@@ -430,14 +417,15 @@ $this->db->or_not_like('body', 'match');

Permits you to write the HAVING portion of your query:

$this->db->having('user_id = 45'); -

// Produces: HAVING 'user_id = 45' -
+

+// Produces: HAVING user_id = 45

You can also pass an array of multiple values as well:

$this->db->having(array('title =' => 'My Title', 'id <' => $id)); -

// Produces: HAVING title = 'My Title', 'id < 45'
+

+// Produces: HAVING title = 'My Title', id < 45 -- cgit v1.2.3-24-g4f1b