" . lang('Unable to show the table definition') . ": " . mysql_error() . ".
\n";
} else {
$auto_increment_only = true;
echo "\n";
while ($row = mysql_fetch_assoc($result)) {
if (!$row["auto_increment"]) {
$auto_increment_only = false;
}
echo "" . htmlspecialchars($row["Field"]) . " | $row[Type]" . ($row["Null"] == "YES" ? " NULL" : "") . " |
\n";
}
echo "
\n";
mysql_free_result($result);
echo "";
echo '' . lang('Alter table') . '';
echo ($auto_increment_only ? '' : ' ' . lang('Default values') . '');
echo "
\n";
echo "" . lang('Indexes') . "
\n";
$indexes = indexes($_GET["table"]);
if ($indexes) {
echo "\n";
foreach ($indexes as $index) {
ksort($index["columns"]);
echo "$index[type] | " . implode(", ", $index["columns"]) . " |
\n";
}
echo "
\n";
}
echo '' . lang('Alter indexes') . "
\n";
$foreign_keys = foreign_keys($_GET["table"]);
if ($foreign_keys) {
echo "" . lang('Foreign keys') . "
\n";
echo "\n";
foreach ($foreign_keys as $foreign_key) {
echo "" . implode(", ", $foreign_key[2]) . " | " . (strlen($foreign_key[0]) && $foreign_key[0] !== $_GET["db"] ? "" . htmlspecialchars($foreign_key[0]) . "." : "") . htmlspecialchars($foreign_key[1]) . "(" . implode(", ", $foreign_key[3]) . ") |
\n";
}
echo "
\n";
}
}
if (mysql_get_server_info() >= 5) {
$result = mysql_query("SHOW TRIGGERS LIKE '" . mysql_real_escape_string($_GET["table"]) . "'");
if (mysql_num_rows($result)) {
echo "" . lang('Triggers') . "
\n";
echo "\n";
while ($row = mysql_fetch_assoc($result)) {
echo "$row[Timing] | $row[Event] | " . htmlspecialchars($row["Statement"]) . " |
\n";
}
echo "
\n";
}
mysql_free_result($result);
}