mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 14:16:39 +02:00
small code refactoring
This commit is contained in:
@@ -106,17 +106,12 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
|
||||
$ok = @mysqli_set_charset($this->connection, $config['charset']); // intentionally @
|
||||
}
|
||||
if (!$ok) {
|
||||
$ok = @mysqli_query($this->connection, "SET NAMES '$config[charset]'"); // intentionally @
|
||||
if (!$ok) {
|
||||
throw new DibiDriverException(mysqli_error($this->connection), mysqli_errno($this->connection));
|
||||
}
|
||||
$this->query("SET NAMES '$config[charset]'");
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($config['sqlmode'])) {
|
||||
if (!@mysqli_query($this->connection, "SET sql_mode='$config[sqlmode]'")) { // intentionally @
|
||||
throw new DibiDriverException(mysqli_error($this->connection), mysqli_errno($this->connection));
|
||||
}
|
||||
$this->query("SET sql_mode='$config[sqlmode]'");
|
||||
}
|
||||
|
||||
$this->buffered = empty($config['unbuffered']);
|
||||
|
Reference in New Issue
Block a user