1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-13 17:44:11 +02:00

* fixed DibiPostgreDriver::insertId

* changed URL to http://dibiphp.com
This commit is contained in:
David Grudl
2007-12-05 09:27:55 +00:00
parent 7d964e054b
commit dfacb48449
24 changed files with 85 additions and 75 deletions

View File

@@ -9,11 +9,11 @@
* This source file is subject to the "dibi license" that is bundled
* with this package in the file license.txt.
*
* For more information please see http://php7.org/dibi/
* For more information please see http://dibiphp.com/
*
* @copyright Copyright (c) 2005, 2007 David Grudl
* @license http://php7.org/dibi/license dibi license
* @link http://php7.org/dibi/
* @license http://dibiphp.com/license dibi license
* @link http://dibiphp.com/
* @package dibi
*/
@@ -32,6 +32,7 @@
* - 'charset' - character encoding to set
* - 'unbuffered' - sends query without fetching and buffering the result rows automatically?
* - 'options' - driver specific constants (MYSQLI_*)
* - 'sqlmode' - see http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html
* - 'lazy' - if TRUE, connection will be established only when required
*
* @author David Grudl
@@ -109,10 +110,14 @@ 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']);
if (!$ok) $ok = @mysqli_query($this->connection, "SET NAMES '" . $config['charset'] . "'");
if (!$ok) $ok = @mysqli_query($this->connection, "SET NAMES '$config[charset]'");
if (!$ok) $this->throwException();
}
if (isset($config['sqlmode'])) {
if (!@mysqli_query($this->connection, "SET sql_mode='$config[sqlmode]'")) $this->throwException();
}
$this->buffered = empty($config['unbuffered']);
}