diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-02-24 10:55:50 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-02-24 10:55:50 +0100 |
commit | ba291df44d1a258adca7843d8cb7215f290a8155 (patch) | |
tree | 6c2a61624f7ee08f2da45f40f1a1499e0d7f13fa /system/database/drivers/mysql | |
parent | 6806cd0f5a7be278da7d2c22fcfc31aff8ee2c71 (diff) | |
parent | 5148029aaf204fb3e7e4f24a794bee781d0c218b (diff) |
Merge upstream branch
Diffstat (limited to 'system/database/drivers/mysql')
-rw-r--r-- | system/database/drivers/mysql/mysql_driver.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 067710ff0..c88a8a766 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -119,11 +119,23 @@ 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); + if ($database === '') + { + $database = $this->database; + } + + if (@mysql_select_db($database, $this->conn_id)) + { + $this->database = $database; + return TRUE; + } + + return FALSE; } // -------------------------------------------------------------------- |