mirror of
https://github.com/vrana/adminer.git
synced 2026-07-06 08:40:05 +02:00
Decomposition
New functions git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@2 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
36
table.inc.php
Normal file
36
table.inc.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
page_header(lang('Table') . ": " . htmlspecialchars($_GET["table"]));
|
||||
echo "<h2>" . lang('Table') . ": " . htmlspecialchars($_GET["table"]) . "</h2>\n";
|
||||
|
||||
$result = mysql_query("SHOW FULL COLUMNS FROM " . idf_escape($_GET["table"]));
|
||||
echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
echo "<tr><th>" . htmlspecialchars($row["Field"]) . "</th><td>$row[Type]" . ($row["Null"] == "NO" ? " NOT NULL" : "") . "</td></tr>\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
mysql_free_result($result);
|
||||
echo '<p><a href="' . htmlspecialchars($SELF) . 'create=' . urlencode($_GET["table"]) . '">' . lang('Alter table') . "</a></p>\n";
|
||||
|
||||
$indexes = indexes($_GET["table"]);
|
||||
if ($indexes) {
|
||||
echo "<h3>" . lang('Indexes') . "</h3>\n";
|
||||
echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
|
||||
foreach ($indexes as $type => $index) {
|
||||
foreach ($index as $columns) {
|
||||
sort($columns);
|
||||
echo "<tr><td>$type</td><td><i>" . implode("</i>, <i>", $columns) . "</i></td></tr>\n";
|
||||
}
|
||||
}
|
||||
echo "</table>\n";
|
||||
}
|
||||
|
||||
$result = mysql_query("SHOW TRIGGERS LIKE '" . mysql_real_escape_string($_GET["table"]) . "'");
|
||||
if (mysql_num_rows($result)) {
|
||||
echo "<h3>" . lang('Triggers') . "</h3>\n";
|
||||
echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
echo "<tr><th>$row[Timing]</th><th>$row[Event]</th><td>" . htmlspecialchars($row["Statement"]) . "</td></tr>\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
}
|
||||
mysql_free_result($result);
|
||||
Reference in New Issue
Block a user