diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-02-22 15:05:47 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-02-22 15:05:47 +0100 |
commit | 11454e039fd82f2fd4ee2f186ad0317e3435f187 (patch) | |
tree | 473dd84e9d593768ea0f321d6371cb50b6997705 /system/database/drivers/mysqli/mysqli_driver.php | |
parent | 7a2412cfe7f7d8db3eb845542609c476c52efc3d (diff) |
Add an optional database name parameter to db_select()
Diffstat (limited to 'system/database/drivers/mysqli/mysqli_driver.php')
-rw-r--r-- | system/database/drivers/mysqli/mysqli_driver.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index a79b2a4ad..0b80f55be 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -119,11 +119,12 @@ class CI_DB_mysqli_driver extends CI_DB { /** * Select the database * + * @param string database name * @return bool */ - public function db_select() + public function db_select($database = '') { - return @mysqli_select_db($this->conn_id, $this->database); + return @mysqli_select_db($this->conn_id, ($database == '' ? $this->database : $database)); } // -------------------------------------------------------------------- |