1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 17:44:07 +02:00

Set now() for timestamp only in single edit (bug #2929925)

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1291 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2010-01-11 19:58:32 +00:00
parent dfbd4608b7
commit dc86757fcf

View File

@@ -83,7 +83,7 @@ if ($fields) {
if (!$_POST["save"] && is_string($value)) { if (!$_POST["save"] && is_string($value)) {
$value = $adminer->editVal($value, $field); $value = $adminer->editVal($value, $field);
} }
$function = ($_POST["save"] ? (string) $_POST["function"][$name] : ($update && $field["on_update"] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : (isset($value) ? '' : 'NULL')))); $function = ($_POST["save"] ? (string) $_POST["function"][$name] : ($where && $field["on_update"] == "CURRENT_TIMESTAMP" ? "now" : ($value === false ? null : (isset($value) ? '' : 'NULL'))));
if ($field["type"] == "timestamp" && $value == "CURRENT_TIMESTAMP") { if ($field["type"] == "timestamp" && $value == "CURRENT_TIMESTAMP") {
$value = ""; $value = "";
$function = "now"; $function = "now";