diff options
author | Pascal Kriete <pascal@pascalkriete.com> | 2011-08-12 18:54:13 +0200 |
---|---|---|
committer | Pascal Kriete <pascal@pascalkriete.com> | 2011-08-12 18:54:13 +0200 |
commit | c4f024641ab69ed9cce62a2864e47e060b81048b (patch) | |
tree | a4de86c0c6e95e6042ce66e84bdcd0c18c51d643 /system/database/drivers/mysqli/mysqli_driver.php | |
parent | abccc2fa65eea5f64773952661a8ba79e559333b (diff) | |
parent | b0eae5f81a4cb92911bb215ad814ae5caef4f61d (diff) |
Merging - fingers crossed
Conflicts:
system/database/drivers/mysql/mysql_driver.php
system/database/drivers/mysqli/mysqli_driver.php
system/libraries/Email.php
user_guide/changelog.html
user_guide/database/configuration.html
user_guide/helpers/url_helper.html
user_guide/libraries/cart.html
user_guide/libraries/form_validation.html
Diffstat (limited to 'system/database/drivers/mysqli/mysqli_driver.php')
-rw-r--r-- | system/database/drivers/mysqli/mysqli_driver.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index b8586c21d..b1796c9df 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -54,6 +54,9 @@ class CI_DB_mysqli_driver extends CI_DB { */ var $delete_hack = TRUE; + // whether SET NAMES must be used to set the character set + var $use_set_names; + // -------------------------------------------------------------------- /** @@ -132,15 +135,13 @@ class CI_DB_mysqli_driver extends CI_DB { */ function _db_set_charset($charset, $collation) { - static $use_set_names; - - if ( ! isset($use_set_names)) + if ( ! isset($this->use_set_names)) { // mysqli_set_charset() requires MySQL >= 5.0.7, use SET NAMES as fallback - $use_set_names = (version_compare(mysqli_get_server_info($this->conn_id), '5.0.7', '>=')) ? FALSE : TRUE; + $this->use_set_names = (version_compare(mysqli_get_server_info($this->conn_id), '5.0.7', '>=')) ? FALSE : TRUE; } - if ($use_set_names) + if ($this->use_set_names === TRUE) { return @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'"); } |