]> git.joonet.de Git - adminer.git/commitdiff
Use now function instead of CURRENT_TIMESTAMP
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 21 Aug 2009 17:08:10 +0000 (17:08 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 21 Aug 2009 17:08:10 +0000 (17:08 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@996 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/edit.inc.php
adminer/include/adminer.inc.php
editor/include/adminer.inc.php

index 951be334ced0caf5a7b6bd8ce8252c30fcbb9c43..a63343517ddb1cc4040b17d958d047927944c186 100644 (file)
@@ -78,6 +78,10 @@ if ($fields) {
                        $value = $adminer->editVal($value, $field);
                }
                $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") {
+                       $value = "";
+                       $function = "now";
+               }
                input($field, $value, $function);
                echo "\n";
        }
index 2cbfa2d1993d4308fe973a76bd83b969d866dc61..a619a8f7d74e6dfffa353c161e03a5ff55a68008 100644 (file)
@@ -400,8 +400,6 @@ class Adminer {
                        $return = "$function(" . idf_escape($name) . ", $return)";
                } elseif (ereg('^(md5|sha1|password)$', $function)) {
                        $return = "$function($return)";
-               } elseif (ereg('date|time', $field["type"]) && $value == "CURRENT_TIMESTAMP") {
-                       $return = $value;
                }
                return $return;
        }
index b82cc2ded3177ef3bb3ac18d17182fb087ecebe3..feb73935a5cd17bc47a7ed4fcbbee7942edb4e38 100644 (file)
@@ -331,8 +331,6 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5
                );
                if (!ereg('varchar|text', $field["type"]) && $field["full_type"] != "tinyint(1)" && !strlen($value)) {
                        $return = "NULL";
-               } elseif (ereg('date|time', $field["type"]) && $value == "CURRENT_TIMESTAMP") {
-                       $return = $value;
                }
                return $return;
        }