diff options
Diffstat (limited to 'system/database/DB_utility.php')
-rw-r--r-- | system/database/DB_utility.php | 60 |
1 files changed, 58 insertions, 2 deletions
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() { |