From 37f4b9caa02783e06dd7c5318200113409a0deb1 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 1 Jul 2011 17:56:50 -0500 Subject: backed out 648b42a75739, which was a NON-trivial whitespace commit. It broke the Typography class's string replacements, for instance --- user_guide/database/helpers.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'user_guide/database/helpers.html') diff --git a/user_guide/database/helpers.html b/user_guide/database/helpers.html index 650dd7a0b..107d2ed85 100644 --- a/user_guide/database/helpers.html +++ b/user_guide/database/helpers.html @@ -67,12 +67,12 @@ Query Helpers

$this->db->affected_rows()

Displays the number of affected rows, when doing "write" type queries (insert, update, etc.).

-

Note: In MySQL "DELETE FROM TABLE" returns 0 affected rows. The database class has a small hack that allows it to return the -correct number of affected rows. By default this hack is enabled but it can be turned off in the database driver file.

+

Note: In MySQL "DELETE FROM TABLE" returns 0 affected rows. The database class has a small hack that allows it to return the +correct number of affected rows. By default this hack is enabled but it can be turned off in the database driver file.

$this->db->count_all();

-

Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

+

Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. Example:

echo $this->db->count_all('my_table');

// Produces an integer, like 25 @@ -90,11 +90,11 @@ correct number of affected rows. By default this hack is enabled but it can be t

$this->db->last_query();

-

Returns the last query that was run (the query string, not the result). Example:

+

Returns the last query that was run (the query string, not the result). Example:

$str = $this->db->last_query();

-// Produces: SELECT * FROM sometable.... +// Produces: SELECT * FROM sometable....
@@ -109,7 +109,7 @@ correct number of affected rows. By default this hack is enabled but it can be t $str = $this->db->insert_string('table_name', $data);
-

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

+

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

INSERT INTO table_name (name, email, url) VALUES ('Rick', 'rick@example.com', 'example.com')

Note: Values are automatically escaped, producing safer queries.

-- cgit v1.2.3-24-g4f1b