Respect MySQL version
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@60 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
e75952cd7f
commit
f32b615eba
|
@ -45,7 +45,7 @@ if (strlen($_GET["db"])) {
|
||||||
} else {
|
} else {
|
||||||
$result = mysql_query("SHOW DATABASES");
|
$result = mysql_query("SHOW DATABASES");
|
||||||
while ($row = mysql_fetch_assoc($result)) {
|
while ($row = mysql_fetch_assoc($result)) {
|
||||||
if ($row["Database"] != "information_schema") {
|
if ($row["Database"] != "information_schema" || mysql_get_server_info() < 5) {
|
||||||
if (mysql_select_db($row["Database"])) {
|
if (mysql_select_db($row["Database"])) {
|
||||||
dump($row["Database"]);
|
dump($row["Database"]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ if (isset($_GET["dump"])) {
|
||||||
} else {
|
} else {
|
||||||
page_header(htmlspecialchars(lang('Database') . ": " . $_GET["db"]));
|
page_header(htmlspecialchars(lang('Database') . ": " . $_GET["db"]));
|
||||||
echo '<p><a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Alter database') . "</a></p>\n";
|
echo '<p><a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Alter database') . "</a></p>\n";
|
||||||
|
if (mysql_get_server_info() >= 5) {
|
||||||
$result = mysql_query("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = '" . mysql_real_escape_string($_GET["db"]) . "'");
|
$result = mysql_query("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = '" . mysql_real_escape_string($_GET["db"]) . "'");
|
||||||
if (mysql_num_rows($result)) {
|
if (mysql_num_rows($result)) {
|
||||||
echo "<h2>" . lang('Routines') . "</h2>\n";
|
echo "<h2>" . lang('Routines') . "</h2>\n";
|
||||||
|
@ -48,5 +49,6 @@ if (isset($_GET["dump"])) {
|
||||||
}
|
}
|
||||||
mysql_free_result($result);
|
mysql_free_result($result);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
page_footer();
|
page_footer();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,13 +32,15 @@ if ($foreign_keys) {
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = mysql_query("SHOW TRIGGERS LIKE '" . mysql_real_escape_string($_GET["table"]) . "'");
|
if (mysql_get_server_info() >= 5) {
|
||||||
if (mysql_num_rows($result)) {
|
$result = mysql_query("SHOW TRIGGERS LIKE '" . mysql_real_escape_string($_GET["table"]) . "'");
|
||||||
|
if (mysql_num_rows($result)) {
|
||||||
echo "<h3>" . lang('Triggers') . "</h3>\n";
|
echo "<h3>" . lang('Triggers') . "</h3>\n";
|
||||||
echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
|
echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
|
||||||
while ($row = mysql_fetch_assoc($result)) {
|
while ($row = mysql_fetch_assoc($result)) {
|
||||||
echo "<tr><th>$row[Timing]</th><th>$row[Event]</th><td>" . htmlspecialchars($row["Statement"]) . "</td></tr>\n";
|
echo "<tr><th>$row[Timing]</th><th>$row[Event]</th><td>" . htmlspecialchars($row["Statement"]) . "</td></tr>\n";
|
||||||
}
|
}
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
|
}
|
||||||
|
mysql_free_result($result);
|
||||||
}
|
}
|
||||||
mysql_free_result($result);
|
|
||||||
|
|
Loading…
Reference in a new issue