summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysql/mysql_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-02-22 15:05:47 +0100
committerAndrey Andreev <narf@bofh.bg>2012-02-22 15:05:47 +0100
commit11454e039fd82f2fd4ee2f186ad0317e3435f187 (patch)
tree473dd84e9d593768ea0f321d6371cb50b6997705 /system/database/drivers/mysql/mysql_driver.php
parent7a2412cfe7f7d8db3eb845542609c476c52efc3d (diff)
Add an optional database name parameter to db_select()
Diffstat (limited to 'system/database/drivers/mysql/mysql_driver.php')
-rw-r--r--system/database/drivers/mysql/mysql_driver.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index 067710ff0..207a68f14 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -119,11 +119,12 @@ class CI_DB_mysql_driver extends CI_DB {
/**
* Select the database
*
+ * @param string database name
* @return bool
*/
- public function db_select()
+ public function db_select($database = '')
{
- return @mysql_select_db($this->database, $this->conn_id);
+ return @mysql_select_db(($database == '' ? $this->database : $database), $this->conn_id);
}
// --------------------------------------------------------------------