diff --git a/abstraction.inc.php b/abstraction.inc.php index a02933cc..a0a60b66 100644 --- a/abstraction.inc.php +++ b/abstraction.inc.php @@ -19,6 +19,9 @@ if (extension_loaded("mysqli")) { } function result($result, $field = 0) { + if (!$result) { + return false; + } $row = $result->fetch_array(); return $row[$field]; } @@ -72,6 +75,9 @@ if (extension_loaded("mysqli")) { } function result($result, $field = 0) { + if (!$result) { + return false; + } return mysql_result($result->_result, 0, $field); } @@ -160,6 +166,9 @@ if (extension_loaded("mysqli")) { } function result($result, $field = 0) { + if (!$result) { + return false; + } $row = $result->fetch(); return $row[$field]; } diff --git a/dump.inc.php b/dump.inc.php index bad01177..480d321a 100644 --- a/dump.inc.php +++ b/dump.inc.php @@ -16,7 +16,7 @@ if ($_POST) { 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"; } diff --git a/export.inc.php b/export.inc.php index 48794a30..95f61ba8 100644 --- a/export.inc.php +++ b/export.inc.php @@ -32,7 +32,7 @@ function dump_table($table, $style, $is_view = false) { } 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"; } } } diff --git a/index.php b/index.php index 87fd6edb..85067acc 100644 --- a/index.php +++ b/index.php @@ -160,7 +160,7 @@ if (isset($_GET["download"])) { echo '
' . lang('Create procedure') . ' ' . lang('Create function') . "
\n"; } - if ($mysql->server_info >= 5.1) { + if ($mysql->server_info >= 5.1 && ($result = $mysql->query("SHOW EVENTS"))) { echo "" . lang('Name') . " | " . lang('Schedule') . " | " . lang('Start') . " | " . lang('End') . " |
---|