Don't save undefined atributes.

This commit is contained in:
kj 2020-07-17 21:54:17 -04:00
parent d04cd18c9a
commit 5679bbf2c5

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();