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(); $atts = $this->getVars();
foreach ($atts as $key => $value) { foreach ($atts as $key => $value) {
$into[] = "`$key`"; if (isset($value)) {
$values[] = "'".$db->real_escape_string($value)."'"; $into[] = "`$key`";
$values[] = "'".$db->real_escape_string($value)."'";
}
} }
$table = static::table(); $table = static::table();