diff --git a/ChangeLog b/ChangeLog index 3e193e96a..03fec6f96 100755 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,8 @@ $Source$ 495360 (cookie with domain), experimental, thanks to Piotr Roszatycki (d3xter) and Christoph (certelt). * tbl_properties.inc.php3: clarifications + * tbl_create.php3, tbl_addfield.php3, tbl_properties.inc.php3: + radio buttons for indexes. 2002-02-09 Loïc Chapeaux * libraries/functions.js: improved the "mark row" feature (it wasn't diff --git a/tbl_addfield.php3 b/tbl_addfield.php3 index 3f6a5c062..6ee2cdf7d 100755 --- a/tbl_addfield.php3 +++ b/tbl_addfield.php3 @@ -28,8 +28,20 @@ $err_url = 'tbl_properties.php3' if (isset($submit)) { $query = ''; - // Builds the field creation statement and alters the table + // transform the radio button field_key into 3 arrays $field_cnt = count($field_name); + for ($i = 0; $i < $field_cnt; ++$i) { + if (${'field_key_'.$i} == 'primary_'.$i) { + $field_primary[]=$i; + } + if (${'field_key_'.$i} == 'index_'.$i) { + $field_index[]=$i; + } + if (${'field_key_'.$i} == 'unique_'.$i) { + $field_unique[]=$i; + } + } + // Builds the field creation statement and alters the table for ($i = 0; $i < $field_cnt; ++$i) { if (get_magic_quotes_gpc()) { $field_name[$i] = stripslashes($field_name[$i]); diff --git a/tbl_create.php3 b/tbl_create.php3 index 3a4936deb..1bc855d27 100755 --- a/tbl_create.php3 +++ b/tbl_create.php3 @@ -34,9 +34,21 @@ mysql_select_db($db); if (isset($submit)) { $sql_query = $query_cpy = ''; + // transform the radio button field_key into 3 arrays + $field_cnt = count($field_name); + for ($i = 0; $i < $field_cnt; ++$i) { + if (${'field_key_'.$i} == 'primary_'.$i) { + $field_primary[]=$i; + } + if (${'field_key_'.$i} == 'index_'.$i) { + $field_index[]=$i; + } + if (${'field_key_'.$i} == 'unique_'.$i) { + $field_unique[]=$i; + } + } // Builds the fields creation statements - $fields_cnt = count($field_name); - for ($i = 0; $i < $fields_cnt; $i++) { + for ($i = 0; $i < $field_cnt; $i++) { if (empty($field_name[$i])) { continue; } @@ -87,7 +99,7 @@ if (isset($submit)) { $sql_query .= $query; $query_cpy .= "\n" . ' ' . $query; } // end for - unset($fields_cnt); + unset($field_cnt); unset($query); $sql_query = ereg_replace(', $', '', $sql_query); $query_cpy = ereg_replace(', $', '', $query_cpy); diff --git a/tbl_properties.inc.php3 b/tbl_properties.inc.php3 index 0b49d02a5..5f1f8dd5e 100755 --- a/tbl_properties.inc.php3 +++ b/tbl_properties.inc.php3 @@ -42,6 +42,7 @@ if (!$is_backup) { echo " $strPrimary\n"; echo " $strIndex\n"; echo " $strUnique\n"; + echo " ---\n"; echo " $strIdxFulltext\n"; } ?> @@ -235,13 +236,16 @@ for ($i = 0 ; $i < $num_fields; $i++) { echo "\n"; ?> - /> + /> - /> + /> - /> + /> + + + = 32323) {