Don't save undefined atributes.

This commit is contained in:
kj 2020-07-17 21:54:17 -04:00
parent d04cd18c9a
commit 5679bbf2c5
1 changed files with 4 additions and 2 deletions

View File

@ -243,8 +243,10 @@ class ModelMySQL {
$atts = $this->getVars();
foreach ($atts as $key => $value) {
$into[] = "`$key`";
$values[] = "'".$db->real_escape_string($value)."'";
if (isset($value)) {
$into[] = "`$key`";
$values[] = "'".$db->real_escape_string($value)."'";
}
}
$table = static::table();