}
function edit_type($key, $field, $collations, $foreign_keys = array()) {
- global $types, $unsigned, $inout;
+ global $structured_types, $unsigned, $inout;
?>
-<td><select name="<?php echo $key; ?>[type]" onchange="editing_type_change(this);"><?php echo optionlist(array_keys($types) + ($foreign_keys ? array(lang('Foreign keys') => $foreign_keys) : array()), $field["type"]); ?></select>
+<td><select name="<?php echo $key; ?>[type]" onchange="editing_type_change(this);"><?php echo optionlist($structured_types + ($foreign_keys ? array(lang('Foreign keys') => $foreign_keys) : array()), $field["type"]); ?></select>
<td><input name="<?php echo $key; ?>[length]" value="<?php echo htmlspecialchars($field["length"]); ?>" size="3">
<td><?php
echo "<select name=\"$key" . '[collation]"' . (ereg('(char|text|enum|set)$', $field["type"]) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
}
// value means maximum unsigned length
-$types = array(
- "tinyint" => 3, "smallint" => 5, "mediumint" => 8, "int" => 10, "bigint" => 20,
- "float" => 12, "double" => 21, "decimal" => 66,
- "date" => 10, "datetime" => 19, "timestamp" => 19, "time" => 10, "year" => 4,
- "char" => 255, "varchar" => 65535,
- "binary" => 255, "varbinary" => 65535,
- "tinytext" => 255, "text" => 65535, "mediumtext" => 16777215, "longtext" => 4294967295,
- "tinyblob" => 255, "blob" => 65535, "mediumblob" => 16777215, "longblob" => 4294967295,
- "enum" => 65535, "set" => 64,
-);
+$types = array();
+$structured_types = array();
+foreach (array(
+ lang('Numbers') => array("tinyint" => 3, "smallint" => 5, "mediumint" => 8, "int" => 10, "bigint" => 20, "float" => 12, "double" => 21, "decimal" => 66),
+ lang('Date and time') => array("date" => 10, "datetime" => 19, "timestamp" => 19, "time" => 10, "year" => 4),
+ lang('Strings') => array("char" => 255, "varchar" => 65535, "tinytext" => 255, "text" => 65535, "mediumtext" => 16777215, "longtext" => 4294967295),
+ lang('Binary') => array("binary" => 255, "varbinary" => 65535, "tinyblob" => 255, "blob" => 65535, "mediumblob" => 16777215, "longblob" => 4294967295),
+ lang('Lists') => array("enum" => 65535, "set" => 64),
+) as $key => $val) {
+ $types += $val;
+ $structured_types[$key] = array_keys($val);
+}
$unsigned = array("unsigned", "zerofill", "unsigned zerofill");
Customization: Adminer class
E-mail sending
Create single column foreign key in table structure
+Separate types to groups in table creation
+Show type in field name title (thanks to Jakub Sochor)
+Preselect now() for timestamp columns (thanks to paranoiq)
+Faster multiple update, clone and delete
+Use HTML Strict instead of XHTML
+Fixed grant ALL PRIVILEGES with GRANT OPTION
+Fixed CSV import
Adminer 1.11.1 (released 2009-07-03):
Fix problem with enabled Filter extension