Don't save undefined atributes.

This commit is contained in:
kj 2020-07-22 10:25:51 -04:00
parent 5679bbf2c5
commit a7cb44a04b

View File

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