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 /user_guide/database | |
parent | 5192e5c8e94f956784063812da6378adb3cb1b7c (diff) |
database exists function in dbutil
Diffstat (limited to 'user_guide/database')
-rw-r--r-- | user_guide/database/utilities.html | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html index a26e0f35b..f46db6820 100644 --- a/user_guide/database/utilities.html +++ b/user_guide/database/utilities.html @@ -66,6 +66,7 @@ Database Utility Class <ul> <li><a href="#init">Initializing the Utility Class</a></li> <li><a href="#list">Listing your Databases</a></li> +<li><a href="#exists">Checking for a specific Database</a></li> <li><a href="#opttb">Optimizing your Tables</a></li> <li><a href="#repair">Repairing your Databases</a></li> <li><a href="#optdb">Optimizing your Database</a></li> @@ -99,6 +100,24 @@ foreach($dbs as $db)<br /> {<br /> echo $db;<br /> }</code> + + +<h2><a name="exists"></a>$this->db->database_exists();</h2> + +<p>Sometimes it's helpful to know whether a particular database exists. +Returns a boolean TRUE/FALSE. Usage example:</p> + +<code> +if ($this->db->database_exists('database_name'))<br /> +{<br /> + // some code...<br /> +} +</code> + +<p>Note: Replace <em>database_name</em> with the name of the table you are looking for.</p> + + + <h2><a name="opttb"></a>$this->dbutil->optimize_table('table_name');</h2> <p class="important"><strong>Note:</strong> This features is only available for MySQL/MySQLi databases.</p> |