diff options
author | admin <devnull@localhost> | 2006-09-25 05:44:04 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-09-25 05:44:04 +0200 |
commit | 72496373008b263e098cf6082cdce1d47d01d3f1 (patch) | |
tree | 887849565e73eaef2ffa95b3c722ed15f3e508bc /system/database/drivers/mysql/mysql_utility.php | |
parent | 6ca6f9471ba31f7cba9054d075b4f90382b2d410 (diff) |
Diffstat (limited to 'system/database/drivers/mysql/mysql_utility.php')
-rw-r--r-- | system/database/drivers/mysql/mysql_utility.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index d4e97867a..5bbf46810 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -53,6 +53,29 @@ class CI_DB_mysql_utility extends CI_DB_utility { // -------------------------------------------------------------------- /** + * List databases + * + * @access public + * @return bool + */ + function list_databases() + { + $query = $this->db->query("SHOW DATABASES"); + $dbs = array(); + if ($query->num_rows() > 0) + { + foreach ($query->result_array() as $row) + { + $dbs[] = current($row); + } + } + + return $dbs; + } + + // -------------------------------------------------------------------- + + /** * Version number query string * * @access public |