summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysqli
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/mysqli')
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php20
1 files changed, 7 insertions, 13 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 827470078..f9a20ea2f 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -173,6 +173,13 @@ class CI_DB_mysqli_driver extends CI_DB {
return ($this->db->db_debug) ? $this->db->display_error($message, '', TRUE) : FALSE;
}
+ if ( ! $mysqli->set_charset($this->char_set))
+ {
+ log_message('error', "Database: Unable to set the configured connection charset ('{$this->char_set}').");
+ $mysqli->close();
+ return ($this->db->db_debug) ? $this->display_error('db_unable_to_set_charset', $charset) : FALSE;
+ }
+
return $mysqli;
}
@@ -224,19 +231,6 @@ class CI_DB_mysqli_driver extends CI_DB {
// --------------------------------------------------------------------
/**
- * Set client character set
- *
- * @param string $charset
- * @return bool
- */
- protected function _db_set_charset($charset)
- {
- return $this->conn_id->set_charset($charset);
- }
-
- // --------------------------------------------------------------------
-
- /**
* Database version number
*
* @return string