diff options
author | Derek Allard <derek.allard@ellislab.com> | 2010-02-04 17:47:01 +0100 |
---|---|---|
committer | Derek Allard <derek.allard@ellislab.com> | 2010-02-04 17:47:01 +0100 |
commit | e7f0325af984392aa4c509dc5a5ca409f5e9474a (patch) | |
tree | 1fbd61e82de91af494242b33fb812f870da86c4a /system/database/DB_utility.php | |
parent | 5192e5c8e94f956784063812da6378adb3cb1b7c (diff) |
database exists function in dbutil
Diffstat (limited to 'system/database/DB_utility.php')
-rw-r--r-- | system/database/DB_utility.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 94e7a0bda..af62dcf3d 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -75,6 +75,20 @@ class CI_DB_utility extends CI_DB_forge { // -------------------------------------------------------------------- /** + * Determine if a particular database exists + * + * @access public + * @param string + * @return boolean + */ + function database_exists($database_name) + { + return ( ! in_array($database_name, $this->list_databases())) ? FALSE : TRUE; + } + + // -------------------------------------------------------------------- + + /** * Optimize Table * * @access public |