query("SHOW FULL COLUMNS FROM " . idf_escape($_GET["table"])); if (!$result) { $error = h($dbh->error); } $table_status = ($result ? table_status($_GET["table"]) : array()); $is_view = !isset($table_status["Rows"]); page_header(($result && $is_view ? lang('View') : lang('Table')) . ": " . h($_GET["table"]), $error); if ($result) { $auto_increment_only = true; $comments = false; $rows = array(); while ($row = $result->fetch_assoc()) { if (!$row["auto_increment"]) { $auto_increment_only = false; } if (strlen(trim($row["Comment"]))) { $comments = true; } $rows[] = $row; } echo "
" . h($row["Field"]); echo " | " . h($row["Type"]) . ($row["Null"] == "YES" ? " NULL" : ""); echo ($comments ? " | " . (strlen(trim($row["Comment"])) ? h($row["Comment"]) : " ") : ""); echo "\n"; } echo " |
---|
"; if ($is_view) { echo '' . lang('Alter view') . ''; } else { echo '' . lang('Alter table') . ''; echo ($auto_increment_only ? '' : ' ' . lang('Default values') . ''); } echo ' ' . lang('Select table') . ''; echo ' ' . lang('New item') . ''; if (!$is_view) { echo "
$index[type] | " . implode(", ", $print) . "\n"; } echo " |
---|
' . lang('Alter indexes') . "\n"; if ($table_status["Engine"] == "InnoDB") { echo "
" . implode(", ", array_map('h', $foreign_key["source"])) . ""; echo " | $link"; echo "(" . implode(", ", array_map('h', $foreign_key["target"])) . ")"; echo " | " . (!strlen($foreign_key["db"]) ? '' . lang('Alter') . '' : ' '); } echo " |
---|
' . lang('Add foreign key') . "\n"; } if ($dbh->server_info >= 5) { echo "
$row[Timing] | $row[Event] | " . h($row["Trigger"]) . " | " . lang('Alter') . "\n"; } echo " |
---|
' . lang('Add trigger') . "\n"; } } }