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 {
|
||||
$result = mysql_query("SHOW DATABASES");
|
||||
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"])) {
|
||||
dump($row["Database"]);
|
||||
}
|
||||
|
|
28
index.php
28
index.php
|
@ -32,21 +32,23 @@ if (isset($_GET["dump"])) {
|
|||
} else {
|
||||
page_header(htmlspecialchars(lang('Database') . ": " . $_GET["db"]));
|
||||
echo '<p><a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Alter database') . "</a></p>\n";
|
||||
$result = mysql_query("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = '" . mysql_real_escape_string($_GET["db"]) . "'");
|
||||
if (mysql_num_rows($result)) {
|
||||
echo "<h2>" . lang('Routines') . "</h2>\n";
|
||||
echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
echo "<tr>";
|
||||
echo "<td>" . htmlspecialchars($row["ROUTINE_TYPE"]) . "</td>";
|
||||
echo "<th>" . htmlspecialchars($row["ROUTINE_NAME"]) . "</th>"; //! parameters from SHOW CREATE {PROCEDURE|FUNCTION}
|
||||
echo "<td>" . nl2br(htmlspecialchars($row["ROUTINE_DEFINITION"])) . "</td>";
|
||||
echo "</tr>\n";
|
||||
//! call, drop, replace
|
||||
if (mysql_get_server_info() >= 5) {
|
||||
$result = mysql_query("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = '" . mysql_real_escape_string($_GET["db"]) . "'");
|
||||
if (mysql_num_rows($result)) {
|
||||
echo "<h2>" . lang('Routines') . "</h2>\n";
|
||||
echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
echo "<tr>";
|
||||
echo "<td>" . htmlspecialchars($row["ROUTINE_TYPE"]) . "</td>";
|
||||
echo "<th>" . htmlspecialchars($row["ROUTINE_NAME"]) . "</th>"; //! parameters from SHOW CREATE {PROCEDURE|FUNCTION}
|
||||
echo "<td>" . nl2br(htmlspecialchars($row["ROUTINE_DEFINITION"])) . "</td>";
|
||||
echo "</tr>\n";
|
||||
//! call, drop, replace
|
||||
}
|
||||
echo "</table>\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
mysql_free_result($result);
|
||||
}
|
||||
mysql_free_result($result);
|
||||
}
|
||||
page_footer();
|
||||
}
|
||||
|
|
|
@ -32,13 +32,15 @@ if ($foreign_keys) {
|
|||
echo "</table>\n";
|
||||
}
|
||||
|
||||
$result = mysql_query("SHOW TRIGGERS LIKE '" . mysql_real_escape_string($_GET["table"]) . "'");
|
||||
if (mysql_num_rows($result)) {
|
||||
echo "<h3>" . lang('Triggers') . "</h3>\n";
|
||||
echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
echo "<tr><th>$row[Timing]</th><th>$row[Event]</th><td>" . htmlspecialchars($row["Statement"]) . "</td></tr>\n";
|
||||
if (mysql_get_server_info() >= 5) {
|
||||
$result = mysql_query("SHOW TRIGGERS LIKE '" . mysql_real_escape_string($_GET["table"]) . "'");
|
||||
if (mysql_num_rows($result)) {
|
||||
echo "<h3>" . lang('Triggers') . "</h3>\n";
|
||||
echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
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