diff --git a/create.inc.php b/create.inc.php index de801a20..a76b50e4 100644 --- a/create.inc.php +++ b/create.inc.php @@ -71,9 +71,7 @@ if ($_POST) { process_fields($row["fields"]); } elseif (strlen($_GET["create"])) { $row = table_status($_GET["create"]); - if ($row["Engine"] == "InnoDB") { - $row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]); - } + table_comment($row); $row["name"] = $_GET["create"]; $row["fields"] = array_values($orig_fields); } else { diff --git a/functions.inc.php b/functions.inc.php index 74be5f71..1a47daec 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -334,3 +334,9 @@ function shorten_utf8($string, $length) { } return nl2br(htmlspecialchars($string)); } + +function table_comment(&$row) { + if ($row["Engine"] == "InnoDB") { + $row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]); + } +} diff --git a/index.php b/index.php index c8f53085..3cb00c1d 100644 --- a/index.php +++ b/index.php @@ -177,6 +177,7 @@ if (isset($_GET["download"])) { echo "\n"; echo '\n"; while ($row = $result->fetch_assoc()) { + table_comment($row); echo '
' . lang('Table') . '' . lang('Engine') . '' . lang('Comment') . '' . lang('Collation') . '' . lang('Data Length') . '' . lang('Index Length') . '' . lang('Data Free') . '' . lang('Auto Increment') . '' . lang('Rows') . "
' . (isset($row["Rows"]) ? '' . htmlspecialchars($row["Name"]) . "$row[Engine]" . htmlspecialchars($row["Comment"]) . "$row[Collation]" : ' ' . htmlspecialchars($row["Name"]) . '' . lang('View')); $row["count"] = $mysql->result($mysql->query("SELECT COUNT(*) FROM " . idf_escape($row["Name"]))); foreach ((isset($row["Rows"]) ? array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create") : array()) + array("count" => "select") as $key => $link) {