From d9491aea0b62ab488d12e7021c2545dee7a828a6 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Fri, 7 May 2004 08:41:08 +0000 Subject: [PATCH] RFE #949594 - Allow changing amount of columns for adding fields/ creating table (without losing previous data) --- ChangeLog | 5 +++++ tbl_addfield.php | 7 ++++++- tbl_create.php | 4 +++- tbl_properties.inc.php | 8 +++++++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a43a91a96..481ef50bf 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-05-07 Garvin Hicking + * tbl_create.php, tbl_addfield.php, tbl_properties.inc.php: + RFE #949594 - Allow changing amount of columns for adding fields/ + creating table (without losing previous data) + 2004-05-07 Alexander M. Turek * README: Updated copyright as discussed a couple of days ago. diff --git a/tbl_addfield.php b/tbl_addfield.php index 5b301a5e1..44484dc4c 100644 --- a/tbl_addfield.php +++ b/tbl_addfield.php @@ -24,7 +24,12 @@ $err_url = 'tbl_properties.php?' . PMA_generate_common_url($db, $table); * The form used to define the field to add has been submitted */ $abort = false; -if (isset($submit)) { +if (isset($submit_num_fields)) { + if (isset($orig_after_field)) { + $after_field = $orig_after_field; + } + $regenerate = TRUE; +} else if (isset($submit)) { $query = ''; // Transforms the radio button field_key into 3 arrays diff --git a/tbl_create.php b/tbl_create.php index e47d2c737..9befeaa9d 100644 --- a/tbl_create.php +++ b/tbl_create.php @@ -32,7 +32,9 @@ PMA_DBI_select_db($db); * The form used to define the structure of the table has been submitted */ $abort = FALSE; -if (isset($submit)) { +if (isset($submit_num_fields)) { + $regenerate = TRUE; +} else if (isset($submit)) { $sql_query = $query_cpy = ''; // Transforms the radio button field_key into 3 arrays diff --git a/tbl_properties.inc.php b/tbl_properties.inc.php index 284b8c543..e6dcf299d 100644 --- a/tbl_properties.inc.php +++ b/tbl_properties.inc.php @@ -145,7 +145,7 @@ for ($i = 0 ; $i < $num_fields; $i++) { $row['Field'] = (isset($field_name) && isset($field_name[$i]) ? $field_name[$i] : FALSE); $row['Type'] = (isset($field_type) && isset($field_type[$i]) ? $field_type[$i] : FALSE); $row['Null'] = (isset($field_null) && isset($field_null[$i]) ? $field_null[$i] : ''); - if ($row['Null'] == '') { + if (isset($field_type[$i]) && $row['Null'] == '') { $submit_null = TRUE; } @@ -606,6 +606,12 @@ echo "\n"; ?> +' . $strOr . '  ' . $strFields . ':' . "\n"; + echo ' ' . '' . "\n"; + echo ' ' . ' ' . "\n"; +?>