Display MySQL variables

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@712 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-06-16 15:10:37 +00:00
parent bbaecdba80
commit f4e0a1cd92
5 changed files with 19 additions and 1 deletions

View file

@ -8,6 +8,7 @@ function connect_error() {
echo '<p><a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Create new database') . "</a></p>\n";
echo '<p><a href="' . htmlspecialchars($SELF) . 'privileges=">' . lang('Privileges') . "</a></p>\n";
echo '<p><a href="' . htmlspecialchars($SELF) . 'processlist=">' . lang('Process list') . "</a></p>\n";
echo '<p><a href="' . htmlspecialchars($SELF) . 'variables=">' . lang('Variables') . "</a></p>\n";
echo "<p>" . lang('MySQL version: %s through PHP extension %s', "<b" . ($dbh->server_info < 4.1 ? " class='binary'" : "") . ">$dbh->server_info</b>", "<b>$dbh->extension</b>") . "</p>\n";
echo "<p>" . lang('Logged as: %s', "<b>" . htmlspecialchars($dbh->result($dbh->query("SELECT USER()"))) . "</b>") . "</p>\n";
}
@ -15,7 +16,7 @@ function connect_error() {
}
$dbh->query("SET SQL_QUOTE_SHOW_CREATE=1");
if (!(strlen($_GET["db"]) ? $dbh->select_db($_GET["db"]) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]))) {
if (!(strlen($_GET["db"]) ? $dbh->select_db($_GET["db"]) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]) || isset($_GET["variables"]))) {
if (strlen($_GET["db"])) {
unset($_SESSION["databases"][$_GET["server"]]);
}

View file

@ -126,6 +126,8 @@ if (isset($_GET["download"])) {
include "./processlist.inc.php";
} elseif (isset($_GET["select"])) {
include "./select.inc.php";
} elseif (isset($_GET["variables"])) {
include "./variables.inc.php";
} else {
include "./db.inc.php";
}

View file

@ -214,4 +214,5 @@ $translations = array(
'(anywhere)' => '(kdekoliv)',
'%.3f s' => '%.3f s',
'History' => 'Historie',
'Variables' => 'Proměnné',
);

13
adminer/variables.inc.php Normal file
View file

@ -0,0 +1,13 @@
<?php
page_header(lang('Variables'));
echo "<table cellspacing='0'>\n";
$result = $dbh->query("SHOW VARIABLES");
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<th><code class='jush-sql_set'>" . htmlspecialchars($row["Variable_name"]) . "</code></th>";
echo "<td>" . (strlen(trim($row["Value"])) ? htmlspecialchars($row["Value"]) : "&nbsp;") . "</td>";
echo "</tr>\n";
}
$result->free();
echo "</table>\n";

View file

@ -5,6 +5,7 @@ Display execution time in SQL query
Relative date and time functions
Version checker
Save queries to history and display it on SQL page
Display MySQL variables
Ability to select all rows on current page of select
Separate JavaScript functions
Always use the default style before the external one