mirror of
https://github.com/dg/dibi.git
synced 2025-08-11 16:44:30 +02:00
* new: DibiResult::fetchAssoc() supports "object" mode via @ descriptor
* fixed mysqli_set_charset in PHP < 5.1.5
This commit is contained in:
@@ -108,8 +108,11 @@ class DibiMySqliDriver extends NObject implements DibiDriverInterface
|
||||
}
|
||||
|
||||
if (isset($config['charset'])) {
|
||||
// affects the character set used by mysql_real_escape_string() (was added in MySQL 5.0.7 and PHP 5.0.5)
|
||||
$ok = @mysqli_set_charset($this->connection, $config['charset']);
|
||||
$ok = FALSE;
|
||||
if (version_compare(PHP_VERSION , '5.1.5', '>=')) {
|
||||
// affects the character set used by mysql_real_escape_string() (was added in MySQL 5.0.7 and PHP 5.0.5, fixed in PHP 5.1.5)
|
||||
$ok = @mysqli_set_charset($this->connection, $config['charset']);
|
||||
}
|
||||
if (!$ok) $ok = @mysqli_query($this->connection, "SET NAMES '$config[charset]'");
|
||||
if (!$ok) $this->throwException();
|
||||
}
|
||||
|
Reference in New Issue
Block a user