1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-05 07:54:24 +03:00

fix DbSimple for boolean value. Issue #50

This commit is contained in:
Mzhelskiy Maxim 2011-11-29 08:10:38 +04:00
parent 4dbecb63da
commit ab476ea71d

View file

@ -809,7 +809,13 @@ class DbSimple_Generic_Database extends DbSimple_Generic_LastError
if (!is_array($value)) return 'DBSIMPLE_ERROR_VALUE_NOT_ARRAY';
$parts = array();
foreach ($value as $k=>$v) {
$v = $v === null? 'NULL' : $this->escape($v);
if ($v === null) {
$v = 'NULL';
} elseif ($v === false) {
$v = '0';
} else {
$v = $this->escape($v);
}
if (!is_int($k)) {
$k = $this->escape($k, true);
$parts[] = "$k=$v";