[adminer-svn] SF.net SVN: adminer:[996] trunk
Database management in a single PHP file
Brought to you by:
jakubvrana
From: <jak...@us...> - 2009-08-21 17:08:20
|
Revision: 996 http://adminer.svn.sourceforge.net/adminer/?rev=996&view=rev Author: jakubvrana Date: 2009-08-21 17:08:10 +0000 (Fri, 21 Aug 2009) Log Message: ----------- Use now function instead of CURRENT_TIMESTAMP Modified Paths: -------------- trunk/adminer/edit.inc.php trunk/adminer/include/adminer.inc.php trunk/editor/include/adminer.inc.php Modified: trunk/adminer/edit.inc.php =================================================================== --- trunk/adminer/edit.inc.php 2009-08-21 17:01:22 UTC (rev 995) +++ trunk/adminer/edit.inc.php 2009-08-21 17:08:10 UTC (rev 996) @@ -78,6 +78,10 @@ $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"; } Modified: trunk/adminer/include/adminer.inc.php =================================================================== --- trunk/adminer/include/adminer.inc.php 2009-08-21 17:01:22 UTC (rev 995) +++ trunk/adminer/include/adminer.inc.php 2009-08-21 17:08:10 UTC (rev 996) @@ -400,8 +400,6 @@ $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; } Modified: trunk/editor/include/adminer.inc.php =================================================================== --- trunk/editor/include/adminer.inc.php 2009-08-21 17:01:22 UTC (rev 995) +++ trunk/editor/include/adminer.inc.php 2009-08-21 17:08:10 UTC (rev 996) @@ -331,8 +331,6 @@ ); 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; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |