summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-04-14 14:59:54 +0200
committerAndrey Andreev <narf@devilix.net>2015-04-14 14:59:54 +0200
commit8af87468487101e14e69effb80a166870f1b79be (patch)
treeb12767afbe33649224b1eee5cc0d4b8091f99be9 /system/database/drivers/pdo
parentaaca76cf4d9ea66249771b89a84c1bd436296b07 (diff)
Fix #3773
Diffstat (limited to 'system/database/drivers/pdo')
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
index 67dc5f5ec..206d83595 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
@@ -157,6 +157,30 @@ class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver {
// --------------------------------------------------------------------
/**
+ * Select the database
+ *
+ * @param string $database
+ * @return bool
+ */
+ public function db_select($database = '')
+ {
+ if ($database === '')
+ {
+ $database = $this->database;
+ }
+
+ if (FALSE !== $this->simple_query('USE '.$this->escape_identifiers($database)))
+ {
+ $this->database = $database;
+ return TRUE;
+ }
+
+ return FALSE;
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Show table query
*
* Generates a platform-specific query string so that the table names can be fetched