summaryrefslogtreecommitdiffstats
path: root/system/database/DB_driver.php
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-01 05:38:04 +0200
committeradmin <devnull@localhost>2006-10-01 05:38:04 +0200
commitb2a9ceccdb85050cb494e6d0a98b0a49495d29bb (patch)
tree16307166046e516304e5d38a072b6e8534657927 /system/database/DB_driver.php
parent0e42554740e2256eb9bf33bfb2f91788a99a1348 (diff)
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r--system/database/DB_driver.php45
1 files changed, 14 insertions, 31 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 5102cc74c..81af466ef 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -555,37 +555,6 @@ class CI_DB_driver {
// --------------------------------------------------------------------
- // --------------------------------------------------------------------
-
- /**
- * List databases
- *
- * @access public
- * @return bool
- */
- function list_databases()
- {
- // Is there a cached result?
- if (isset($this->cache['db_names']))
- {
- return $this->cache['db_names'];
- }
-
- $query = $this->query($this->_list_database());
- $dbs = array();
- if ($query->num_rows() > 0)
- {
- foreach ($query->result_array() as $row)
- {
- $dbs[] = current($row);
- }
- }
-
- return $this->cache['db_names'] =& $dbs;
- }
-
- // --------------------------------------------------------------------
-
/**
* Returns an array of table names
*
@@ -694,6 +663,20 @@ class CI_DB_driver {
return $this->cache['field_names'][$table] =& $retval;
}
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Determine if a particular field exists
+ * @access public
+ * @param string
+ * @param string
+ * @return boolean
+ */
+ function field_exists($field_name, $table_name)
+ {
+ return ( ! in_array($field_name, $this->list_fields($table_name))) ? FALSE : TRUE;
+ }
// --------------------------------------------------------------------