}
function result($result, $field = 0) {
+ if (!$result) {
+ return false;
+ }
$row = $result->fetch_array();
return $row[$field];
}
}
function result($result, $field = 0) {
+ if (!$result) {
+ return false;
+ }
return mysql_result($result->_result, 0, $field);
}
}
function result($result, $field = 0) {
+ if (!$result) {
+ return false;
+ }
$row = $result->fetch();
return $row[$field];
}
echo "SET NAMES utf8;\n";
echo "SET foreign_key_checks = 0;\n";
echo "SET time_zone = '" . $mysql->escape_string($mysql->result($mysql->query("SELECT @@time_zone"))) . "';\n";
- echo "SET max_allowed_packet = $max_packet, GLOBAL max_allowed_packet = $max_packet;\n";
+ echo "SET max_allowed_packet = $max_packet;\n"; // ignored because of MySQL bug #22891
echo "\n";
}
}
if ($row_size > $max_packet) {
$max_packet = min(1073741824, 1024 * ceil($row_size / 1024));
- echo "SET max_allowed_packet = $max_packet, GLOBAL max_allowed_packet = $max_packet;\n";
+ echo "SET max_allowed_packet = $max_packet;\n";
}
}
}
echo '<tr class="nowrap"><td>' . (isset($row["Rows"]) ? '<input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . '"' . (in_array($row["Name"], (array) $_POST["tables"], true) ? ' checked="checked"' : '') . ' /></td><th><a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a></th><td align='left'>$row[Engine]</td><td align='left'>$row[Collation]" : ' </td><th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . '</a></th><td colspan="6">' . 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) {
- echo '</td><td align="right">' . (isset($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($row["Name"]) . '">' . number_format($row[$key], 0, '.', lang(',')) . '</a>' : ' ');
+ echo '</td><td align="right">' . (strlen($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($row["Name"]) . '">' . number_format($row[$key], 0, '.', lang(',')) . '</a>' : ' ');
}
echo "</td></tr>\n";
}
echo '<p><a href="' . htmlspecialchars($SELF) . 'procedure=">' . lang('Create procedure') . '</a> <a href="' . htmlspecialchars($SELF) . 'function=">' . lang('Create function') . "</a></p>\n";
}
- if ($mysql->server_info >= 5.1) {
+ if ($mysql->server_info >= 5.1 && ($result = $mysql->query("SHOW EVENTS"))) {
echo "<h3>" . lang('Events') . "</h3>\n";
- $result = $mysql->query("SHOW EVENTS");
if ($result->num_rows) {
echo "<table border='0' cellspacing='0' cellpadding='2'>\n";
echo "<thead><tr><th>" . lang('Name') . "</th><td>" . lang('Schedule') . "</td><td>" . lang('Start') . "</td><td>" . lang('End') . "</td></tr></thead>\n";