diff --git a/ChangeLog b/ChangeLog index 2510ebb2a..bb5f63fdd 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2003-12-08 Garvin Hicking + * tbl_change.php: Fixed Bug #856436 (not displaying default values) + 2003-12-08 Marc Delisle * new language: basque, thanks to Axier Lopez (axierl@euskalerria.org) diff --git a/tbl_change.php b/tbl_change.php index 655fabda7..6dfcf3645 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -198,7 +198,7 @@ $fields_cnt = mysql_num_rows($table_def); // Set a flag here because the 'if' would not be valid in the loop // if we set a value in some field $insert_mode = (!isset($row) ? TRUE : FALSE); -$loop_array = (isset($row) ? $row : array(0 => array(0 => 0))); +$loop_array = (isset($row) ? $row : array(0 => FALSE)); while ($trow = PMA_mysql_fetch_array($table_def)) { $trow_table_def[] = $trow; @@ -206,6 +206,10 @@ while ($trow = PMA_mysql_fetch_array($table_def)) { $o_rows = 0; foreach($loop_array AS $vrowcount => $vrow) { + if ($vrow === FALSE) { + unset($vrow); + } + $vresult = (isset($result) && is_array($result) && isset($result[$vrowcount]) ? $result[$vrowcount] : $result); ?> @@ -278,7 +282,11 @@ foreach($loop_array AS $vrowcount => $vrow) { && (!isset($row_table_def['Default']))) { // INSERT case if ($insert_mode) { - $vrow[$rowfield] = date('Y-m-d H:i:s', time()); + if (isset($vrow)) { + $vrow[$rowfield] = date('Y-m-d H:i:s', time()); + } else { + $vrow = array($rowfield => date('Y-m-d H:i:s', time())); + } } // UPDATE case with an empty and not NULL value under PHP4 else if (empty($vrow[$rowfield]) && is_null($vrow[$rowfield])) { @@ -457,7 +465,7 @@ foreach($loop_array AS $vrowcount => $vrow) { if (!(($cfg['ProtectBinary'] && $is_blob) || ($cfg['ProtectBinary'] == 'all' && $is_binary)) && $row_table_def['Null'] == 'YES') { echo '