Skip to content

CI_DB_utility

Mathieu Nayrolles edited this page Jan 20, 2016 · 1 revision

CI_DB_utility

Database Utility Class

  • Class name: CI_DB_utility
  • Namespace:
  • This is an abstract class

Properties

$db

protected object $db

Database object

  • Visibility: protected

$_list_databases

protected string $_list_databases = FALSE

List databases statement

  • Visibility: protected

$_optimize_table

protected string $_optimize_table = FALSE

OPTIMIZE TABLE statement

  • Visibility: protected

$_repair_table

protected string $_repair_table = FALSE

REPAIR TABLE statement

  • Visibility: protected

Methods

__construct

void CI_DB_utility::__construct($db)

Class constructor

  • Visibility: public

Arguments

  • $db mixed

list_databases

array CI_DB_utility::list_databases()

List databases

  • Visibility: public

database_exists

boolean CI_DB_utility::database_exists(string $database_name)

Determine if a particular database exists

  • Visibility: public

Arguments

  • $database_name string

optimize_table

mixed CI_DB_utility::optimize_table(string $table_name)

Optimize Table

  • Visibility: public

Arguments

  • $table_name string

optimize_database

mixed CI_DB_utility::optimize_database()

Optimize Database

  • Visibility: public

repair_table

mixed CI_DB_utility::repair_table(string $table_name)

Repair Table

  • Visibility: public

Arguments

  • $table_name string

csv_from_result

string CI_DB_utility::csv_from_result(object $query, string $delim, string $newline, string $enclosure)

Generate CSV from a query result object

  • Visibility: public

Arguments

  • $query object - <p>Query result object</p>
  • $delim string - <p>Delimiter (default: ,)</p>
  • $newline string - <p>Newline character (default: \n)</p>
  • $enclosure string - <p>Enclosure (default: ")</p>

xml_from_result

string CI_DB_utility::xml_from_result(object $query, array $params)

Generate XML data from a query result object

  • Visibility: public

Arguments

  • $query object - <p>Query result object</p>
  • $params array - <p>Any preferences</p>

backup

string CI_DB_utility::backup(array $params)

Database Backup

  • Visibility: public

Arguments

  • $params array
Clone this wiki locally