From 3ed8c51254a5b26d951fa675802fcf69adf9638e Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 29 Sep 2006 23:26:28 +0000 Subject: --- user_guide/database/export.html | 158 ------------------------------------- user_guide/database/index.html | 1 - user_guide/database/utilities.html | 57 ++++++++++++- 3 files changed, 56 insertions(+), 160 deletions(-) delete mode 100644 user_guide/database/export.html (limited to 'user_guide') diff --git a/user_guide/database/export.html b/user_guide/database/export.html deleted file mode 100644 index 6932fbcb8..000000000 --- a/user_guide/database/export.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - -Code Igniter User Guide - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -

Code Igniter User Guide Version 1.5.0

-
- - - - - - - - - -
- - - -
- - - -
- -

Database Export Class

- -

The Database Utilities Class contains functions that help you export your data.

- -

Important:  This class must be initialized independently since it is a separate class from the main Database class. -More info below...

- - -

Initializing the Export Class

- -

To initialize this class please use the following code:

- -$this->load->dbexport() - -

You can also autoload this class from within your config/autoload.php file by specifying dbexport in the $autoload['libraries'] array.

- -

Once initialized you will access the functions using the $this->dbexport object:

- -$this->dbexport->some_function() - - - -

$this->dbexport->cvs_from_result($db_result)

- -

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

- - -$this->load->dbexport();
-
-$query = $this->db->query("SELECT * FROM mytable");
-
-echo $this->dbexport->cvs_from_result($query); -
- -

The second and third parameters allows you to -set the delimiter and newline character. By default tabs are used as the delimiter and "\n" is used as a new line. Example: - - -$delimiter = ",";
-$newline = "\r\n";
-
-echo $this->dbexport->cvs_from_result($query, $delimiter, $newline); -
- -

Important:  This function will NOT write the CVS file for you. It simply creates the CVS layout. -If you need to write the file use the File Helper.

- - - -

$this->dbexport->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:

- - -$this->load->dbexport();
-
-$query = $this->db->query("SELECT * FROM mytable");
-
-$config = array (
-                  'root'    => 'root',
-                  'element' => 'element',
-                  'newline' => "\n",
-                  ';tab'    => "\t"
-                );
-
-echo $this->dbexport->cvs_from_result($query, $config); -
- -

Important:  This function will NOT write the CVS file for you. It simply creates the CVS layout. -If you need to write the file use the File Helper.

- - - - - -
- - - - - - - \ No newline at end of file diff --git a/user_guide/database/index.html b/user_guide/database/index.html index 61864221e..78f90478f 100644 --- a/user_guide/database/index.html +++ b/user_guide/database/index.html @@ -79,7 +79,6 @@ structures and Active Record patterns. The database functions offer clear, simpl
  • Field MetaData
  • Custom Function Calls
  • Database Utilities Class
  • -
  • Database Export Class
  • Database Caching Class
  • diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index e23f1f575..b064c7983 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -193,6 +193,61 @@ if ($result !== FALSE)
    +

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

    + +

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

    + + +$this->load->dbutil();
    +
    +$query = $this->db->query("SELECT * FROM mytable");
    +
    +echo $this->dbutil->cvs_from_result($query); +
    + +

    The second and third parameters allows you to +set the delimiter and newline character. By default tabs are used as the delimiter and "\n" is used as a new line. Example: + + +$delimiter = ",";
    +$newline = "\r\n";
    +
    +echo $this->dbutil->cvs_from_result($query, $delimiter, $newline); +
    + +

    Important:  This function will NOT write the CVS file for you. It simply creates the CVS layout. +If you need to write the file use the File Helper.

    + + + +

    $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:

    + + +$this->load->dbutil();
    +
    +$query = $this->db->query("SELECT * FROM mytable");
    +
    +$config = array (
    +                  'root'    => 'root',
    +                  'element' => 'element',
    +                  'newline' => "\n",
    +                  ';tab'    => "\t"
    +                );
    +
    +echo $this->dbutil->cvs_from_result($query, $config); +
    + +

    Important:  This function will NOT write the CVS file for you. It simply creates the CVS layout. +If you need to write the file use the File Helper.

    + + + + + @@ -204,7 +259,7 @@ Previous Topic:  Custom Function CallsTop of Page   ·   User Guide Home   ·   -Next Topic:  Database Export Class +Next Topic:  Database Caching Class

    Code Igniter  ·  Copyright © 2006  ·  pMachine, Inc.

    -- cgit v1.2.3-24-g4f1b