1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-16 11:04:43 +02:00

* SET CHARACTER SET -> SET NAMES

* %p bug
This commit is contained in:
David Grudl
2007-01-30 21:50:04 +00:00
parent 6536dfb7dd
commit a2b1036a66
6 changed files with 12 additions and 12 deletions

View File

@@ -14,11 +14,11 @@
* @license GNU GENERAL PUBLIC LICENSE v2
* @package dibi
* @category Database
* @version 0.7a $Revision$ $Date$
* @version 0.7b $Revision$ $Date$
*/
define('DIBI', 'Version 0.7a $Revision$');
define('DIBI', 'Version 0.7b $Revision$');
if (version_compare(PHP_VERSION , '5.0.3', '<'))

View File

@@ -80,7 +80,7 @@ class DibiMySqlDriver extends DibiDriver {
if (!empty($config['charset'])) {
$succ = @mysql_query('SET CHARACTER SET '.$config['charset'], $conn);
$succ = @mysql_query("SET NAMES '" . $config['charset'] . "'", $conn);
// don't handle this error...
}

View File

@@ -59,7 +59,7 @@ class DibiMySqliDriver extends DibiDriver {
));
if (!empty($config['charset']))
mysqli_query($conn, 'SET CHARACTER SET '.$config['charset']);
mysqli_query($conn, "SET NAMES '" . $config['charset'] . "'");
$obj = new self($config);
$obj->conn = $conn;

View File

@@ -84,10 +84,10 @@ class DibiTranslator
}
// simple string means SQL
if (is_string($arg) && (!$mod || 'p' == $mod)) {
if (is_string($arg) && (!$mod || 'sql' == $mod)) {
$mod = FALSE;
// will generate new mod
$sql[] = $this->formatValue($arg, 'p');
$sql[] = $this->formatValue($arg, 'sql');
continue;
}