summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-07-15 23:25:15 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-07-15 23:25:15 +0200
commit8a02247acbac87b3b947d9188ec4f5805f2e1a52 (patch)
treeaccf500d1ce73c07c42357fa6cb38ecd81de3d7f /system/database
parent9789f321cd52139d36d1479f07fff3897be48107 (diff)
... set_dbprefix(). Programatically set the prefix, great for multi-site systems that "namespace" with prefixes.
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_active_rec.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index 7ddf20d07..bc11ff436 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -1599,6 +1599,21 @@ class CI_DB_active_record extends CI_DB_driver {
// --------------------------------------------------------------------
/**
+ * Set DB Prefix
+ *
+ * Set's the DB Prefix to something new without needing to reconnect
+ *
+ * @param string the prefix
+ * @return string
+ */
+ public function set_dbprefix($prefix = '')
+ {
+ return $this->dbprefix = $prefix;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Track Aliases
*
* Used to track SQL statements written with aliased tables.