lang
[phpmyadmin/crack.git] / tbl_properties.inc.php3
blob8dbe8b143da49d016a6479a3b513db89238b52e5
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
6 // Get available character sets (MySQL >= 4.1)
7 if (PMA_MYSQL_INT_VERSION >= 40100 && !defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')) {
8 include('./libraries/mysql_charsets.lib.php3');
12 <?php if ($cfg['CtrlArrowsMoving']) { ?>
13 <!-- Set on key handler for moving using by Ctrl+arrows -->
14 <script type="text/javascript" language="javascript">
15 <!--
16 document.onkeydown = onKeyDownArrowsHandler;
17 // -->
18 </script>
19 <?php } ?>
21 <form method="post" action="<?php echo $action; ?>" onsubmit="return checkTableEditForm(this, <?php echo $num_fields; ?>)" >
22 <?php
23 echo PMA_generate_common_hidden_inputs($db, $table);
24 if ($action == 'tbl_create.php3') {
26 <input type="hidden" name="reload" value="1" />
27 <?php
29 else if ($action == 'tbl_addfield.php3') {
30 echo "\n";
32 <input type="hidden" name="after_field" value="<?php echo $after_field; ?>" />
33 <?php
35 echo "\n";
37 if (isset($num_fields)) {
39 <input type="hidden" name="orig_num_fields" value="<?php echo $num_fields; ?>" />
40 <?php
43 if (isset($after_field)) {
45 <input type="hidden" name="orig_after_field" value="<?php echo $after_field; ?>" />
46 <?php
49 if (isset($selected) && is_array($selected)) {
50 @reset($selected);
51 while(list($o_fld_nr, $o_fld_val) = each($selected)) {
53 <input type="hidden" name="selected[<?php echo $o_fld_nr; ?>]" value="<?php echo urlencode($o_fld_val); ?>" />
54 <?php
55 if (!isset($true_selected)) {
57 <input type="hidden" name="true_selected[<?php echo $o_fld_nr; ?>]" value="<?php echo urlencode($o_fld_val); ?>" />
58 <?php
63 if (isset($true_selected) && is_array($true_selected)) {
64 @reset($true_selected);
65 while(list($o_fld_nr, $o_fld_val) = each($true_selected)) {
67 <input type="hidden" name="true_selected[<?php echo $o_fld_nr; ?>]" value="<?php echo urlencode($o_fld_val); ?>" />
68 <?php
72 } elseif (isset($field)) {
74 <input type="hidden" name="orig_field" value="<?php echo urlencode($field); ?>" />
75 <input type="hidden" name="true_selected[] value="<?php echo (isset($orig_field) ? $orig_field : urlencode($field)); ?>" />
76 <?php
79 $is_backup = ($action != 'tbl_create.php3' && $action != 'tbl_addfield.php3');
81 $header_cells = array();
82 $content_cells = array();
84 $header_cells[] = $strField;
85 $header_cells[] = $strType . '<br /><span style="font-weight: normal">' . PMA_showMySQLDocu('Reference', 'Column_types') . '</span>';
86 $header_cells[] = $strLengthSet;
87 if (PMA_MYSQL_INT_VERSION >= 40100) {
88 $header_cells[] = $strCharset;
90 $header_cells[] = $strAttr;
91 $header_cells[] = $strNull;
92 $header_cells[] = $strDefault . '**';
93 $header_cells[] = $strExtra;
95 require('./libraries/relation.lib.php3');
96 require('./libraries/transformations.lib.php3');
97 $cfgRelation = PMA_getRelationsParam();
99 $comments_map = array();
100 $mime_map = array();
101 $available_mime = array();
103 if ($cfgRelation['commwork']) {
104 $comments_map = PMA_getComments($db, $table);
105 $header_cells[] = $strComments;
107 if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) {
108 $mime_map = PMA_getMIME($db, $table);
109 $available_mime = PMA_getAvailableMIMEtypes();
111 $header_cells[] = $strMIME_MIMEtype;
112 $header_cells[] = $strMIME_transformation;
113 $header_cells[] = $strMIME_transformation_options . '***';
118 // lem9: We could remove this 'if' and let the key information be shown and
119 // editable. However, for this to work, tbl_alter must be modified to use the
120 // key fields, as tbl_addfield does.
122 if (!$is_backup) {
123 $header_cells[] = $strPrimary;
124 $header_cells[] = $strIndex;
125 $header_cells[] = $strUnique;
126 $header_cells[] = '---';
127 $header_cells[] = $strIdxFulltext;
130 // garvin: workaround for field_fulltext, because its submitted indizes contain
131 // the index as a value, not a key. Inserted here for easier maintaineance
132 // and less code to change in existing files.
133 if (isset($field_fulltext) && is_array($field_fulltext)) {
134 @reset($field_fulltext);
135 while(list($fulltext_nr, $fulltext_indexkey) = each($field_fulltext)) {
136 $submit_fulltext[$fulltext_indexkey] = $fulltext_indexkey;
140 for ($i = 0 ; $i < $num_fields; $i++) {
141 $submit_null = FALSE;
142 if (isset($regenerate) && $regenerate == TRUE) {
143 // An error happened with previous inputs, so we will restore the data
144 // to embed it once again in this form.
146 $row['Field'] = (isset($field_name) && isset($field_name[$i]) ? $field_name[$i] : FALSE);
147 $row['Type'] = (isset($field_type) && isset($field_type[$i]) ? $field_type[$i] : FALSE);
148 $row['Null'] = (isset($field_null) && isset($field_null[$i]) ? $field_null[$i] : '');
149 if ($row['Null'] == '') {
150 $submit_null = TRUE;
153 if (isset(${'field_key_' . $i}) && ${'field_key_' . $i} == 'primary_' . $i) {
154 $row['Key'] = 'PRI';
155 } elseif (isset(${'field_key_' . $i}) && ${'field_key_' . $i} == 'index_' . $i) {
156 $row['Key'] = 'MUL';
157 } elseif (isset(${'field_key_' . $i}) && ${'field_key_' . $i} == 'unique_' . $i) {
158 $row['Key'] = 'UNI';
159 } else {
160 $row['Key'] = '';
163 $row['Default'] = (isset($field_default) && isset($field_default[$i]) ? $field_default[$i] : FALSE);
164 $row['Extra'] = (isset($field_extra) && isset($field_extra[$i]) ? $field_extra[$i] : FALSE);
165 $row['Comment'] = (isset($submit_fulltext) && isset($submit_fulltext[$i]) && ($submit_fulltext[$i] == $i) ? 'FULLTEXT' : FALSE);
167 $submit_length = (isset($field_length) && isset($field_length[$i]) ? $field_length[$i] : FALSE);
168 $submit_attribute = (isset($field_attribute) && isset($field_attribute[$i]) ? $field_attribute[$i] : FALSE);
170 if (isset($field_comments) && isset($field_comments[$i])) {
171 $comments_map[$row['Field']] = $field_comments[$i];
174 if (isset($field_mimetype) && isset($field_mimetype[$i])) {
175 $mime_map[$row['Field']]['mimetype'] = $field_mimetype[$i];
178 if (isset($field_transformation) && isset($field_transformation[$i])) {
179 $mime_map[$row['Field']]['transformation'] = $field_transformation[$i];
182 if (isset($field_transformation_options) && isset($field_transformation_options[$i])) {
183 $mime_map[$row['Field']]['transformation_options'] = $field_transformation_options[$i];
186 } elseif (isset($fields_meta)) {
187 $row = $fields_meta[$i];
190 $bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
192 // Cell index: If certain fields get left out, the counter shouldn't chage.
193 $ci = 0;
194 // Everytime a cell shall be left out the STRG-jumping feature, $ci_offset
195 // has to be incremented ($ci_offset++)
196 $ci_offset = -1;
198 if ($is_backup) {
199 $backup_field = (isset($true_selected) && $true_selected[$i] ? $true_selected[$i] : (isset($row) && isset($row['Field']) ? urlencode($row['Field']) : ''));
200 $content_cells[$i][$ci] = "\n" . '<input type="hidden" name="field_orig[]" value="' . $backup_field . '" />' . "\n";
201 } else {
202 $content_cells[$i][$ci] = '';
205 $content_cells[$i][$ci] .= "\n" . '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '" type="text" name="field_name[]" size="10" maxlength="64" value="' . (isset($row) && isset($row['Field']) ? str_replace('"', '&quot;', $row['Field']) : '') . '" class="textfield" />';
206 $ci++;
207 $content_cells[$i][$ci] = '<select name="field_type[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">' . "\n";
209 if (empty($row['Type'])) {
210 $row['Type'] = '';
211 $type = '';
213 else {
214 $type = $row['Type'];
216 // set or enum types: slashes single quotes inside options
217 if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
218 $type = $tmp[1];
219 $length = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
220 } else {
221 $type = eregi_replace('BINARY', '', $type);
222 $type = eregi_replace('ZEROFILL', '', $type);
223 $type = eregi_replace('UNSIGNED', '', $type);
225 if (strpos($type, '(')) {
226 $length = chop(substr($type, (strpos($type, '(') + 1), (strpos($type, ')') - strpos($type, '(') - 1)));
227 $type = chop(substr($type, 0, strpos($type, '(')));
228 } else {
229 $length = '';
231 } // end if else
233 if (isset($submit_length) && $submit_length != FALSE) {
234 $length = $submit_length;
237 for ($j = 0; $j < count($cfg['ColumnTypes']); $j++) {
238 $content_cells[$i][$ci] .= ' <option value="'. $cfg['ColumnTypes'][$j] . '"';
239 if (strtoupper($type) == strtoupper($cfg['ColumnTypes'][$j])) {
240 $content_cells[$i][$ci] .= ' selected="selected"';
242 $content_cells[$i][$ci] .= '>' . $cfg['ColumnTypes'][$j] . '</option>' . "\n";
243 } // end for
245 $content_cells[$i][$ci] .= ' </select>';
246 $ci++;
248 if ($is_backup) {
249 $content_cells[$i][$ci] = "\n" . '<input type="hidden" name="field_length_orig[]" value="' . urlencode($length) . '" />';
250 } else {
251 $content_cells[$i][$ci] = '';
254 $content_cells[$i][$ci] .= "\n" . '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '" type="text" name="field_length[]" size="8" value="' . str_replace('"', '&quot;', $length) . '" class="textfield" />' . "\n";
255 $ci++;
257 if (eregi('^(set|enum)$', $type)) {
258 $binary = 0;
259 $unsigned = 0;
260 $zerofill = 0;
261 } else {
262 $binary = eregi('BINARY', $row['Type'], $test_attribute1);
263 $unsigned = eregi('UNSIGNED', $row['Type'], $test_attribute2);
264 $zerofill = eregi('ZEROFILL', $row['Type'], $test_attribute3);
267 if (PMA_MYSQL_INT_VERSION >= 40100) {
268 $content_cells[$i][$ci] = '<select name="field_charset[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">' . "\n"
269 . ' <option value=""></option>' . "\n";
270 if (!empty($row['Collation']) && (
271 strtolower(substr($type, 0, 4)) == 'char'
272 || strtolower(substr($type, 0, 7)) == 'varchar'
273 || strtolower(substr($type, 0, 4)) == 'text'
274 || strtolower(substr($type, 0, 8)) == 'tinytext'
275 || strtolower(substr($type, 0, 10)) == 'mediumtext'
276 || strtolower(substr($type, 0, 8)) == 'longtext'
277 || strtolower(substr($type, 0, 3)) == 'set'
278 || strtolower(substr($type, 0, 4)) == 'enum'
279 ) && !$binary) {
280 $real_charset = strpos($row['Collation'], '_') ? substr($row['Collation'], 0, strpos($row['Collation'], '_')) : $row['Collation'];
281 } else {
282 $real_charset = '';
284 for ($j = 0; isset($mysql_charsets[$j]); $j++) {
285 $content_cells[$i][$ci] .= ' <option value="' . $mysql_charsets[$j] . '"' . ($mysql_charsets[$j] == $real_charset ? ' selected="selected"' : '') . '>' . $mysql_charsets[$j] . '</option>' . "\n";
287 unset($j);
288 unset($real_charset);
289 $content_cells[$i][$ci] .= '</select>' . "\n";
290 $ci++;
293 $content_cells[$i][$ci] = '<select name="field_attribute[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">' . "\n";
295 $strAttribute = '';
296 if ($binary) {
297 $strAttribute = 'BINARY';
299 if ($unsigned) {
300 $strAttribute = 'UNSIGNED';
302 if ($zerofill) {
303 $strAttribute = 'UNSIGNED ZEROFILL';
306 if (isset($submit_attribute) && $submit_attribute != FALSE) {
307 $strAttribute = $submit_attribute;
310 for ($j = 0;$j < count($cfg['AttributeTypes']); $j++) {
311 $content_cells[$i][$ci] .= ' <option value="'. $cfg['AttributeTypes'][$j] . '"';
312 if (strtoupper($strAttribute) == strtoupper($cfg['AttributeTypes'][$j])) {
313 $content_cells[$i][$ci] .= ' selected="selected"';
315 $content_cells[$i][$ci] .= '>' . $cfg['AttributeTypes'][$j] . '</option>' . "\n";
318 $content_cells[$i][$ci] .= '</select>';
319 $ci++;
321 $content_cells[$i][$ci] = '<select name="field_null[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">';
323 if ((!isset($row) || empty($row['Null']) || $row['Null'] == 'NOT NULL') && $submit_null == FALSE) {
324 $content_cells[$i][$ci] .= "\n";
325 $content_cells[$i][$ci] .= ' <option value="NOT NULL">not null</option>' . "\n";
326 $content_cells[$i][$ci] .= ' <option value="">null</option>' . "\n";
327 } else {
328 $content_cells[$i][$ci] .= "\n";
329 $content_cells[$i][$ci] .= ' <option value="">null</option>' . "\n";
330 $content_cells[$i][$ci] .= ' <option value="NOT NULL">not null</option>' . "\n";
333 $content_cells[$i][$ci] .= "\n" . '</select>';
334 $ci++;
336 if (isset($row)
337 && !isset($row['Default']) && !empty($row['Null'])) {
338 $row['Default'] = 'NULL';
341 if ($is_backup) {
342 $content_cells[$i][$ci] = "\n" . '<input type="hidden" name="field_default_orig[]" size="8" value="' . (isset($row) && isset($row['Default']) ? urlencode($row['Default']) : '') . '" />';
343 } else {
344 $content_cells[$i][$ci] = "\n";
347 $content_cells[$i][$ci] .= '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '" type="text" name="field_default[]" size="8" value="' . (isset($row) && isset($row['Default']) ? str_replace('"', '&quot;', $row['Default']) : '') . '" class="textfield" />';
348 $ci++;
350 $content_cells[$i][$ci] = '<select name="field_extra[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">';
352 if(!isset($row) || empty($row['Extra'])) {
353 $content_cells[$i][$ci] .= "\n";
354 $content_cells[$i][$ci] .= '<option value=""></option>' . "\n";
355 $content_cells[$i][$ci] .= '<option value="AUTO_INCREMENT">auto_increment</option>' . "\n";
356 } else {
357 $content_cells[$i][$ci] .= "\n";
358 $content_cells[$i][$ci] .= '<option value="AUTO_INCREMENT">auto_increment</option>' . "\n";
359 $content_cells[$i][$ci] .= '<option value=""></option>' . "\n";
362 $content_cells[$i][$ci] .= "\n" . '</select>';
363 $ci++;
365 // garvin: comments
366 if ($cfgRelation['commwork']) {
367 $content_cells[$i][$ci] = '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '" type="text" name="field_comments[]" size="8" value="' . (isset($row) && isset($row['Field']) && is_array($comments_map) && isset($comments_map[$row['Field']]) ? htmlspecialchars($comments_map[$row['Field']]) : '') . '" class="textfield" />';
368 $ci++;
371 // garvin: MIME-types
372 if ($cfgRelation['mimework'] && $cfg['BrowseMIME'] && $cfgRelation['commwork']) {
373 $content_cells[$i][$ci] = '<select id="field_' . $i . '_' . ($ci - $ci_offset) . '" size="1" name="field_mimetype[]">' . "\n";
374 $content_cells[$i][$ci] .= ' <option value=""></option>' . "\n";
375 $content_cells[$i][$ci] .= ' <option value="auto">auto-detect</option>' . "\n";
377 if (is_array($available_mime['mimetype'])) {
378 @reset($available_mime['mimetype']);
379 while(list($mimekey, $mimetype) = each($available_mime['mimetype'])) {
380 $checked = (isset($row) && isset($row['Field']) && isset($mime_map[$row['Field']]['mimetype']) && ($mime_map[$row['Field']]['mimetype'] == str_replace('/', '_', $mimetype)) ? 'selected ' : '');
381 $content_cells[$i][$ci] .= ' <option value="' . str_replace('/', '_', $mimetype) . '" ' . $checked . '>' . htmlspecialchars($mimetype) . '</option>';
385 $content_cells[$i][$ci] .= '</select>';
386 $ci++;
388 $content_cells[$i][$ci] = '<select id="field_' . $i . '_' . ($ci - $ci_offset) . '" size="1" name="field_transformation[]">' . "\n";
389 $content_cells[$i][$ci] .= ' <option value="" title="' . $strNone . '"></option>' . "\n";
390 if (is_array($available_mime['transformation'])) {
391 @reset($available_mime['transformation']);
392 while(list($mimekey, $transform) = each($available_mime['transformation'])) {
393 $checked = (isset($row) && isset($row['Field']) && isset($mime_map[$row['Field']]['transformation']) && ($mime_map[$row['Field']]['transformation'] == $available_mime['transformation_file'][$mimekey]) ? 'selected ' : '');
394 $tooltip = 'strTransformation_' . strtolower(str_replace('.inc.php3', '', $available_mime['transformation_file'][$mimekey]));
395 $tooltip = isset($$tooltip) ? $$tooltip : sprintf(str_replace('<br />', ' ', $strMIME_nodescription), 'PMA_transformation_' . $tooltip . '()');
396 $content_cells[$i][$ci] .= '<option value="' . $available_mime['transformation_file'][$mimekey] . '" ' . $checked . ' title="' . $tooltip . '">' . htmlspecialchars($transform) . '</option>' . "\n";
400 $content_cells[$i][$ci] .= '</select>';
401 $ci++;
403 $content_cells[$i][$ci] = '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '" type="text" name="field_transformation_options[]" size="8" value="' . (isset($row) && isset($row['Field']) && isset($mime_map[$row['Field']]['transformation_options']) ? htmlspecialchars($mime_map[$row['Field']]['transformation_options']) : '') . '" class="textfield" />';
404 $ci++;
407 // lem9: See my other comment about removing this 'if'.
408 if (!$is_backup) {
409 if (isset($row) && isset($row['Key']) && $row['Key'] == 'PRI') {
410 $checked_primary = ' checked="checked"';
411 } else {
412 $checked_primary = '';
414 if (isset($row) && isset($row['Key']) && $row['Key'] == 'MUL') {
415 $checked_index = ' checked="checked"';
416 } else {
417 $checked_index = '';
419 if (isset($row) && isset($row['Key']) && $row['Key'] == 'UNI') {
420 $checked_unique = ' checked="checked"';
421 } else {
422 $checked_unique = '';
424 if (empty($checked_primary)
425 && empty($checked_index)
426 && empty($checked_unique)) {
427 $checked_none = ' checked="checked"';
428 } else {
429 $checked_none = '';
432 if (PMA_MYSQL_INT_VERSION >= 32323
433 &&(isset($row) && isset($row['Comment']) && $row['Comment'] == 'FULLTEXT')) {
434 $checked_fulltext = ' checked="checked"';
435 } else {
436 $checked_fulltext = '';
439 $content_cells[$i][$ci] = "\n" . '<input type="radio" name="field_key_' . $i . '" value="primary_' . $i . '"' . $checked_primary . ' />';
440 $ci++;
442 $content_cells[$i][$ci] = "\n" . '<input type="radio" name="field_key_' . $i . '" value="index_' . $i . '"' . $checked_index . ' />';
443 $ci++;
445 $content_cells[$i][$ci] = "\n" . '<input type="radio" name="field_key_' . $i . '" value="unique_' . $i . '"' . $checked_unique . ' />';
446 $ci++;
448 $content_cells[$i][$ci] = "\n" . '<input type="radio" name="field_key_' . $i . '" value="none_' . $i . '"' . $checked_none . ' />';
449 $ci++;
451 if (PMA_MYSQL_INT_VERSION >= 32323) {
452 $content_cells[$i][$ci] = '<input type="checkbox" name="field_fulltext[]" value="' . $i . '"' . $checked_fulltext . ' />';
453 } // end if (PMA_MYSQL_INT_VERSION >= 32323)
454 } // end if ($action ==...)
455 } // end for
457 if ($cfg['DefaultPropDisplay'] == 'horizontal') {
459 <table border="<?php echo $cfg['Border']; ?>">
460 <tr>
461 <?php
462 @reset($header_cells);
463 while(@list($header_nr, $header_val) = @each($header_cells)) {
465 <th><?php echo $header_val; ?></th>
466 <?php
469 </tr>
470 <?php
471 @reset($content_cells);
472 $i = 0;
473 while(@list($content_nr, $content_row) = @each($content_cells)) {
474 $i++;
475 echo "\n" . '<tr>' . "\n";
477 $bgcolor = ($i % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
479 while(list($content_row_nr, $content_row_val) = @each($content_row)) {
481 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $content_row_val; ?></td>
482 <?php
484 echo "\n" . '</tr>' . "\n";
487 </table>
488 <br />
489 <?php
490 } else {
492 <table border="<?php echo $cfg['Border']; ?>">
493 <?php
494 @reset($header_cells);
495 $i = 0;
496 while(@list($header_nr, $header_val) = @each($header_cells)) {
497 echo "\n" . '<tr>' . "\n";
499 <th align="right"><?php echo $header_val; ?></th>
500 <?php
501 for ($j = 0; $j < count($content_cells); $j++) {
502 if (isset($content_cells[$j][$i]) && $content_cells[$j][$i] != '') {
503 $bgcolor = ($j % 2) ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
505 <td bgcolor="<?php echo $bgcolor; ?>"><?php echo $content_cells[$j][$i]; ?></td>
506 <?php
510 echo "\n" . '</tr>' . "\n";
511 $i++;
514 </table>
515 <br />
516 <?php
519 if ($action == 'tbl_create.php3' && PMA_MYSQL_INT_VERSION >= 32300) {
520 echo "\n";
522 <table>
523 <tr valign="top">
524 <td><?php echo $strTableComments; ?>&nbsp;:</td>
525 <?php
526 if ($action == 'tbl_create.php3') {
527 echo "\n";
529 <td width="25">&nbsp;</td>
530 <td><?php echo $strTableType; ?>&nbsp;:</td>
531 <?php
532 if (PMA_MYSQL_INT_VERSION >= 40100) {
533 echo ' <td width="25">&nbsp;</td>' . "\n"
534 . ' <td>' . $strCharset . '&nbsp;:</td>' . "\n";
537 echo "\n";
539 </tr>
540 <tr>
541 <td>
542 <input type="text" name="comment" size="40" maxlength="80" value="<?php echo (isset($comment) ? $comment : ''); ?>" class="textfield" />
543 </td>
544 <?php
545 // BEGIN - Table Type - 2 May 2001 - Robbat2
546 // change by staybyte - 11 June 2001
547 if ($action == 'tbl_create.php3') {
548 // find mysql capability - staybyte - 11. June 2001
549 $query = 'SHOW VARIABLES LIKE \'have_%\'';
550 $result = PMA_mysql_query($query);
551 if ($result != FALSE && mysql_num_rows($result) > 0) {
552 while ($tmp = PMA_mysql_fetch_array($result)) {
553 if (isset($tmp['Variable_name'])) {
554 switch ($tmp['Variable_name']) {
555 case 'have_bdb':
556 if (isset($tmp['Variable_name']) && $tmp['Value'] == 'YES') {
557 $tbl_bdb = TRUE;
559 break;
560 case 'have_gemini':
561 if (isset($tmp['Variable_name']) && $tmp['Value'] == 'YES') {
562 $tbl_gemini = TRUE;
564 break;
565 case 'have_innodb':
566 if (isset($tmp['Variable_name']) && $tmp['Value'] == 'YES') {
567 $tbl_innodb = TRUE;
569 break;
570 case 'have_isam':
571 if (isset($tmp['Variable_name']) && $tmp['Value'] == 'YES') {
572 $tbl_isam = TRUE;
574 break;
575 } // end switch
576 } // end if
577 } // end while
578 } // end if
579 mysql_free_result($result);
581 echo "\n";
583 <td width="25">&nbsp;</td>
584 <td>
585 <select name="tbl_type">
586 <option <?php echo (isset($tbl_type) && $tbl_type == 'Default' ? 'selected="checked"' : ''); ?> value="Default"><?php echo $strDefault; ?></option>
587 <option <?php echo (isset($tbl_type) && $tbl_type == 'MYISAM' ? 'selected="checked"' : ''); ?> value="MYISAM">MyISAM</option>
588 <option <?php echo (isset($tbl_type) && $tbl_type == 'HEAP' ? 'selected="checked"' : ''); ?> value="HEAP">Heap</option>
589 <option <?php echo (isset($tbl_type) && $tbl_type == 'MERGE' ? 'selected="checked"' : ''); ?> value="MERGE">Merge</option>
590 <?php if (isset($tbl_bdb)) { ?><option <?php echo (isset($tbl_type) && $tbl_type == 'BDB' ? 'selected="checked"' : ''); ?> value="BDB">Berkeley DB</option><?php } ?>
591 <?php if (isset($tbl_gemini)) { ?><option <?php echo (isset($tbl_type) && $tbl_type == 'GEMINI' ? 'selected="checked"' : ''); ?> value="GEMINI">Gemini</option><?php } ?>
592 <?php if (isset($tbl_innodb)) { ?><option <?php echo (isset($tbl_type) && $tbl_type == 'INNO DB' ? 'selected="checked"' : ''); ?> value="InnoDB">INNO DB</option><?php } ?>
593 <?php if (isset($tbl_isam)) { ?><option <?php echo (isset($tbl_type) && $tbl_type == 'ISAM' ? 'selected="checked"' : ''); ?> value="ISAM">ISAM</option><?php } ?>
594 </select>
595 </td>
596 <?php
597 if (PMA_MYSQL_INT_VERSION >= 40100) {
598 echo ' <td width="25">&nbsp;</td>' . "\n"
599 . ' <td>' . "\n"
600 . ' <select name="tbl_charset">' . "\n";
601 for ($i = 0; isset($mysql_charsets[$i]); $i++) {
602 echo ' <option value="' . $mysql_charsets[$i] . '"' . ($mysql_charsets[$i] == 'latin1' ? ' selected="selected"' : '') . '>' . $mysql_charsets[$i] . '</option>' . "\n";
604 unset($i);
605 echo ' </select>' . "\n"
606 . ' </td>' . "\n";
609 echo "\n";
611 </tr>
612 </table>
613 <br />
614 <?php
616 echo "\n";
617 // END - Table Type - 2 May 2001 - Robbat2
620 <input type="submit" name="submit" value="<?php echo $strSave; ?>" />
621 </form>
623 <table>
624 <tr>
625 <td valign="top">*&nbsp;</td>
626 <td>
627 <?php echo $strSetEnumVal . "\n"; ?>
628 </td>
629 </tr>
630 <tr>
631 <td valign="top">**&nbsp;</td>
632 <td>
633 <?php echo $strDefaultValueHelp . "\n"; ?>
634 </td>
635 </tr>
637 <?php
638 if ($cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME']) {
640 <tr>
641 <td valign="top" rowspan="2">***&nbsp;</td>
642 <td>
643 <?php echo $strMIME_transformation_options_note . "\n"; ?>
644 </td>
645 </tr>
647 <tr>
648 <td>
649 <?php echo sprintf($strMIME_transformation_note, '<a href="libraries/transformations/overview.php3?' . PMA_generate_common_url($db, $table) . '" target="_blank">', '</a>') . "\n"; ?>
650 </td>
651 </tr>
652 <?php
656 </table>
657 <br />
659 <center><?php echo PMA_showMySQLDocu('Reference', 'CREATE_TABLE'); ?></center>