From 44bd10fa25c980737e7f2a731aefb46095b1f569 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Tue, 25 Mar 2008 22:27:37 +0000 Subject: userguide note, corrections and omissions --- user_guide/database/active_record.html | 2 +- user_guide/database/connecting.html | 2 +- user_guide/database/forge.html | 8 ++++---- user_guide/database/helpers.html | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index d2c888ceb..533d52dc1 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -397,7 +397,7 @@ $this->db->or_not_like('body', 'match');

$this->db->distinct();

-

Adds the "DISTINCT" keyword to to a query

+

Adds the "DISTINCT" keyword to a query

$this->db->distinct();
$this->db->get('table');

diff --git a/user_guide/database/connecting.html b/user_guide/database/connecting.html index 6cdd109d6..79277e536 100644 --- a/user_guide/database/connecting.html +++ b/user_guide/database/connecting.html @@ -65,7 +65,7 @@ Connecting

Automatically Connecting

The "auto connect" feature will load and instantiate the database class with every page load. -To enable "auto connecting", add the word database to the core array, as indicated in the following file:

+To enable "auto connecting", add the word database to the library array, as indicated in the following file:

application/config/autoload.php

diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html index cfbe005a0..4b0588c6c 100644 --- a/user_guide/database/forge.html +++ b/user_guide/database/forge.html @@ -126,7 +126,7 @@ already be running, since the forge class relies on it.

  • unsigned/true : to generate "UNSIGNED" in the field definition
  • default/value : to generate a default value in the field definition
  • null/true : to generate "NULL" in the field definition. Without this, the field will default to "NOT NULL"
  • -
  • auto_increment/true : generates an auto_increment flag on the field. Note that the field type must
  • +
  • auto_increment/true : generates an auto_increment flag on the field. Note that the field type must integer
  • $fields = array(
                            'blog_id' => array(
    @@ -148,7 +148,7 @@ already be running, since the forge class relies on it.

                                                     'type' => 'TEXT',
                                                     'null' => TRUE,
                                              ),
    -                );
    +                )
    );

    After the fields have been defined, they can be added using $this->dbforge->add_field($fields); followed by a call to the create_table() function.

    $this->dbforge->add_field()

    @@ -187,12 +187,12 @@ already be running, since the forge class relies on it.

    );
    $this->dbforge->add_column('table_name', $fields);

    -// gives ALTER TABLE sites ADD preferences TEXT

    +// gives ALTER TABLE table_name ADD preferences TEXT

    $this->dbforge->drop_column()

    Used to remove a column from a table.

    $this->dbforge->drop_column('table_name', 'column_to_drop');

    $this->dbforge->modify_column()

    -

    The usage of this function is identical to add_coumn(), except it alters an existing column rather than adding a new one. In order to use it you must add a "name" key into the field defining array.

    +

    The usage of this function is identical to add_column(), except it alters an existing column rather than adding a new one. In order to use it you must add a "name" key into the field defining array.

    $fields = array(
                            'old_name' => array(
                                                             'name' => 'new_name',
    diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 409660e2a..b3dab62d7 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -126,8 +126,8 @@ $where = "author_id = 1 AND status = 'active'"; $str = $this->db->update_string('table_name', $data, $where);
    -

    The first parameter is the table name, the second is an associative array with the data to be inserted, and the third parameter is the "where" clause. The above example produces:

    - UPDATE exp_weblog SET name = 'Rick', email = 'rick@your-site.com', url = 'www.your-site.com' WHERE author_id = 1 AND status = 'active' +

    The first parameter is the table name, the second is an associative array with the data to be updated, and the third parameter is the "where" clause. The above example produces:

    + UPDATE table_name SET name = 'Rick', email = 'rick@your-site.com', url = 'www.your-site.com' WHERE author_id = 1 AND status = 'active'

    Note: Values are automatically escaped, producing safer queries.

    -- cgit v1.2.3-24-g4f1b