diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-02-28 13:50:55 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-02-28 13:50:55 +0100 |
commit | d6ded84f70c2a84fb0d161dabdb9656dfdd05698 (patch) | |
tree | a7762a0494558dba944fdec248ec23b7fd82e4c5 /system/database/drivers/mysql/mysql_driver.php | |
parent | cf8bb891df6f42850f57d715ab14af81c9fbd960 (diff) | |
parent | 0aa8c60ae7eee0122c42ae17d42fd5471a575743 (diff) |
Merge upstream branch
Diffstat (limited to 'system/database/drivers/mysql/mysql_driver.php')
-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; } // -------------------------------------------------------------------- |