Доработана базовая модель - при сохранении имена столбцов берутся в кавычки
This commit is contained in:
parent
b12a1c55b3
commit
6a01f3a52b
|
|
@ -284,7 +284,7 @@ abstract class Model
|
||||||
$values = $this->_vals_;
|
$values = $this->_vals_;
|
||||||
unset($values[$this->_primaryKey_]);
|
unset($values[$this->_primaryKey_]);
|
||||||
|
|
||||||
$request = App::DB()->prepare('UPDATE ' . $this->_tableName_ . ' SET ' . implode('=?, ', array_keys($values)) . '=? WHERE ' . $this->_primaryKey_ . '=' . $this->_id_);
|
$request = App::DB()->prepare('UPDATE ' . $this->_tableName_ . ' SET `' . implode('`=?, `', array_keys($values)) . '`=? WHERE ' . $this->_primaryKey_ . '=' . $this->_id_);
|
||||||
$res = $request->execute(array_values($values));
|
$res = $request->execute(array_values($values));
|
||||||
|
|
||||||
return $res ? $this : FALSE;
|
return $res ? $this : FALSE;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue