diff --git a/edit.inc.php b/edit.inc.php index eeca462a..701ffe51 100644 --- a/edit.inc.php +++ b/edit.inc.php @@ -19,7 +19,7 @@ if ($_POST && !$error) { if (!isset($_GET["default"])) { $set[] = idf_escape($name) . " = $val"; } elseif ($field["type"] == "timestamp") { - $set[] = " MODIFY " . idf_escape($name) . " timestamp" . ($field["null"] ? " NULL" : "") . " DEFAULT $val"; //! ON UPDATE + $set[] = " MODIFY " . idf_escape($name) . " timestamp" . ($field["null"] ? " NULL" : "") . " DEFAULT $val" . ($_POST["on_update"][bracket_escape($name)] ? " ON UPDATE CURRENT_TIMESTAMP" : ""); } else { $set[] = " ALTER " . idf_escape($name) . ($val == "NULL" ? " DROP DEFAULT" : " SET DEFAULT $val"); } @@ -70,6 +70,7 @@ if ($_POST) {