bug 609914 default value for datetime ignored

This commit is contained in:
Marc Delisle
2002-09-18 02:44:57 +00:00
parent 54fc7adb7d
commit 1e5387c107
2 changed files with 7 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ $Source$
2002-09-17 Marc Delisle <lem9@users.sourceforge.net>
* lang/spanish: update, thanks to Daniel Hinostroza
* tbl_change.php3: bug 609614, default value for datetime ignored
2002-09-17 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* tbl_change.php3: bug 610310: spaces in drop-down for foreign values

View File

@@ -219,7 +219,12 @@ for ($i = 0; $i < $fields_cnt; $i++) {
$field = $row_table_def['Field'];
// loic1: current date should not be set as default if the field is NULL
// for the current row
if ($row_table_def['Type'] == 'datetime') {
// lem9: but do not put here the current datetime if there is a default
// value (the real default value will be set in the
// Default value logic below)
if (($row_table_def['Type'] == 'datetime')
&& (!isset($row_table_def['Default']))) {
// INSERT case
if ($insert_mode) {
$row[$field] = date('Y-m-d H:i:s', time());