Treat DROP DATABASE from SQL query

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@974 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-08-18 09:15:36 +00:00
parent 70a04751bc
commit 2b3bb44b00

View file

@ -441,16 +441,20 @@ class Adminer {
<?php
if ($missing != "db" && strlen($_GET["db"])) {
$result = $dbh->query("SHOW TABLES");
if (!$result->num_rows) {
echo "<p class='message'>" . lang('No tables.') . "\n";
if (!$result) {
echo "<p class='error'>" . lang('No tables.') . "\n";
} else {
echo "<p id='tables'>\n";
while ($row = $result->fetch_row()) {
echo '<a href="' . h(ME) . 'select=' . urlencode($row[0]) . '">' . lang('select') . '</a> ';
echo '<a href="' . h(ME) . 'table=' . urlencode($row[0]) . '">' . $this->tableName(array("Name" => $row[0])) . "</a><br>\n"; //! Adminer::tableName may work with full table status
if (!$result->num_rows) {
echo "<p class='message'>" . lang('No tables.') . "\n";
} else {
echo "<p id='tables'>\n";
while ($row = $result->fetch_row()) {
echo '<a href="' . h(ME) . 'select=' . urlencode($row[0]) . '">' . lang('select') . '</a> ';
echo '<a href="' . h(ME) . 'table=' . urlencode($row[0]) . '">' . $this->tableName(array("Name" => $row[0])) . "</a><br>\n"; //! Adminer::tableName may work with full table status
}
}
$result->free();
}
$result->free();
echo '<p><a href="' . h(ME) . 'create=">' . lang('Create new table') . "</a>\n";
}
}