From 62ef2742fe49ea7a114a648e854dd5ff81cf0f2c Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Wed, 19 Aug 2009 12:07:37 +0000 Subject: [PATCH] Display column comments git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@979 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/table.inc.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/adminer/table.inc.php b/adminer/table.inc.php index 4e9d803a..65d37c55 100644 --- a/adminer/table.inc.php +++ b/adminer/table.inc.php @@ -1,5 +1,5 @@ query("SHOW COLUMNS FROM " . idf_escape($_GET["table"])); +$result = $dbh->query("SHOW FULL COLUMNS FROM " . idf_escape($_GET["table"])); if (!$result) { $error = h($dbh->error); } @@ -10,12 +10,23 @@ page_header(($result && $is_view ? lang('View') : lang('Table')) . ": " . h($_GE if ($result) { $auto_increment_only = true; - echo "\n"; + $comments = false; + $rows = array(); while ($row = $result->fetch_assoc()) { if (!$row["auto_increment"]) { $auto_increment_only = false; } - echo "
" . h($row["Field"]) . "" . h($row["Type"]) . ($row["Null"] == "YES" ? " NULL" : "") . "\n"; + if (strlen(trim($row["Comment"]))) { + $comments = true; + } + $rows[] = $row; + } + echo "\n"; + foreach ($rows as $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 "
\n"; $result->free();