CodeIgniter Forums
mysqli - Unable to set client connection character set: ISO 8859-15 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: mysqli - Unable to set client connection character set: ISO 8859-15 (/showthread.php?tid=24847)



mysqli - Unable to set client connection character set: ISO 8859-15 - El Forum - 11-22-2009

[eluser]Unknown[/eluser]
Hello, sorry my bad english.

I updated my file database.php with those data

$db['default']['dbdriver'] = "mysqli";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "ISO 8859-15";
$db['default']['dbcollat'] = "latin1_spanish_ci";

When I run CI, it showed this error:

A Database Error Occurred

Unable to set client connection character set: ISO 8859-15


If I change 'mysqli' for 'mysql' and it works

In file mysql_driver.php in method _db_set_charset change return true for the other line and it works too.

function _db_set_charset($charset, $collation) {
return true;
//return @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'");
}

Any idea?


----
Version info
CI 1.7.2
XAMPP 1.7.1. for windows
PHP 5.2.9
MySQL 5.1.33-community
Apache 2.2.11


Thanks for your help