process_fields($row["fields"]);
} elseif (strlen($_GET["create"])) {
$row = table_status($_GET["create"]);
- table_comment($row);
$row["name"] = $_GET["create"];
$row["fields"] = array();
foreach ($orig_fields as $field) {
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="form_check(this, /^(tables|views)\[/);"><th>' . lang('Table') . '<td>' . lang('Engine') . '<td>' . lang('Collation') . '<td>' . lang('Data Length') . '<td>' . lang('Index Length') . '<td>' . lang('Data Free') . '<td>' . lang('Auto Increment') . '<td>' . lang('Rows') . '<td>' . lang('Comment') . "</thead>\n";
foreach ($table_status as $row) {
$name = $row["Name"];
- table_comment($row);
echo '<tr' . odd() . '><td><input type="checkbox" name="' . (isset($row["Rows"]) ? 'tables' : 'views') . '[]" value="' . h($name) . '"' . (in_array($name, $tables_views, true) ? ' checked' : '') . ' onclick="form_uncheck(\'check-all\');">';
echo '<th><a href="' . h(ME) . 'table=' . urlencode($name) . '">' . h($name) . '</a>';
if (isset($row["Rows"])) {
$return = array();
$result = $dbh->query("SHOW TABLE STATUS" . (strlen($name) ? " LIKE " . $dbh->quote(addcslashes($name, "%_")) : ""));
while ($row = $result->fetch_assoc()) {
+ if ($row["Engine"] == "InnoDB") {
+ // ignore internal comment, unnecessary since MySQL 5.1.21
+ $row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]);
+ }
$return[$row["Name"]] = $row;
}
$result->free();
return substr($dbh->quote($val), 1, -1);
}
-function table_comment(&$row) {
- if ($row["Engine"] == "InnoDB") {
- // ignore internal comment, unnecessary since MySQL 5.1.21
- $row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]);
- }
-}
-
function information_schema($db) {
global $dbh;
return ($dbh->server_info >= 5 && $db == "information_schema");