From 39b622db9bda38282a32bb45623da63efe685729 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 16 Jan 2008 21:10:09 +0000 Subject: Many new Active Record functions, and another whack of stuff --- user_guide/database/utilities.html | 62 ++++++++------------------------------ 1 file changed, 12 insertions(+), 50 deletions(-) (limited to 'user_guide/database/utilities.html') diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index 6b6956c88..cdf3f68f5 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 1.5.4

CodeIgniter User Guide Version 1.6.0

@@ -65,8 +65,6 @@ Database Utility Class - -

Initializing the Utility Class

+ +

Initializing the Utility Class

Important:  In order to initialize the Utility class, your database driver must already be running, since the utilities class relies on it.

@@ -91,36 +89,9 @@ already be running, since the utilities class relies on it.

$this->dbutil->some_function() - - - -

$this->dbutil->create_database('db_name')

- -

Permits you to create the database specified in the first parameter. Returns TRUE/FALSE based on success or failure:

- -if ($this->dbutil->create_database('my_db'))
-{
-    echo 'Database created!';
-}
- - - - -

$this->dbutil->drop_database('db_name')

- -

Permits you to drop the database specified in the first parameter. Returns TRUE/FALSE based on success or failure:

- -if ($this->dbutil->drop_database('my_db'))
-{
-    echo 'Database deleted!';
-}
- - - -

$this->dbutil->list_databases()

+

$this->dbutil->list_databases()

Returns an array of database names:

- $dbs = $this->dbutil->list_databases();

@@ -128,10 +99,7 @@ foreach($dbs as $db)
{
    echo $db;
}
- - - -

$this->dbutil->optimize_table('table_name');

+

$this->dbutil->optimize_table('table_name');

Note:  This features is only available for MySQL/MySQLi databases.

@@ -148,8 +116,7 @@ if ($this->dbutil->optimize_table('table_name'))

Note: Not all database platforms support table optimization.

- -

$this->dbutil->repair_table('table_name');

+

$this->dbutil->repair_table('table_name');

Note:  This features is only available for MySQL/MySQLi databases.

@@ -166,8 +133,7 @@ if ($this->dbutil->repair_table('table_name'))

Note: Not all database platforms support table repairs.

- -

$this->dbutil->optimize_database();

+

$this->dbutil->optimize_database();

Note:  This features is only available for MySQL/MySQLi databases.

@@ -185,8 +151,7 @@ if ($result !== FALSE)

Note: Not all database platforms support table optimization.

- -

$this->dbutil->csv_from_result($db_result)

+

$this->dbutil->csv_from_result($db_result)

Permits you to generate a CSV file from a query result. The first parameter of the function must contain the result object from your query. Example:

@@ -213,8 +178,7 @@ echo $this->dbutil->csv_from_result($query, $delimiter, $newline); If you need to write the file use the File Helper.

- -

$this->dbutil->xml_from_result($db_result)

+

$this->dbutil->xml_from_result($db_result)

Permits you to generate an XML file from a query result. The first parameter expects a query result object, the second may contain an optional array of config parameters. Example:

@@ -238,8 +202,7 @@ echo $this->dbutil->xml_from_result($query, $config); If you need to write the file use the File Helper.

- -

$this->dbutil->backup()

+

$this->dbutil->backup()

Permits you to backup your full database or individual tables. The backup data can be compressed in either Zip or Gzip format.

@@ -320,12 +283,11 @@ $this->dbutil->backup($prefs); -- cgit v1.2.3-24-g4f1b