From 83b05a860a5f208d15942b517385848cfe4887bb Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 25 Sep 2006 21:06:46 +0000 Subject: --- system/database/DB_utility.php | 60 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) (limited to 'system/database/DB_utility.php') diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 128984d4f..36d74c5b3 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -232,14 +232,70 @@ class CI_DB_utility { // -------------------------------------------------------------------- + /** + * Drop database + * + * @access public + * @param string the database name + * @return bool + */ + function drop_database($name) + { + $sql = $this->_drop_database($name); + + if (is_bool($sql)) + { + return $sql; + } + + return $this->db->query($sql); + } + // -------------------------------------------------------------------- + /** + * List databases + * + * @access public + * @return bool + */ + function list_databases() + { + $query = $this->db->query($this->_list_database()); + $dbs = array(); + if ($query->num_rows() > 0) + { + foreach ($query->result_array() as $row) + { + $dbs[] = current($row); + } + } + + return $dbs; + } + // -------------------------------------------------------------------- - - function create_table() + /** + * Drop Table + * + * @access public + * @param string the table name + * @return bool + */ + function drop_table($name) { + $sql = $this->_drop_table($name); + + if (is_bool($sql)) + { + return $sql; + } + + return $this->db->query($sql); } + + function alter_table() { -- cgit v1.2.3-24-g4f1b