Select database before SHOW TABLES (bug #2853561)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1070 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
e1ddf9032c
commit
24fc853e7b
|
@ -440,11 +440,8 @@ class Adminer {
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
if ($missing != "db" && strlen(DB)) {
|
if ($missing != "db" && strlen(DB) && $dbh->select_db(DB)) {
|
||||||
$result = $dbh->query("SHOW TABLES");
|
$result = $dbh->query("SHOW TABLES");
|
||||||
if (!$result) {
|
|
||||||
echo "<p class='error'>" . lang('No tables.') . "\n";
|
|
||||||
} else {
|
|
||||||
if (!$result->num_rows) {
|
if (!$result->num_rows) {
|
||||||
echo "<p class='message'>" . lang('No tables.') . "\n";
|
echo "<p class='message'>" . lang('No tables.') . "\n";
|
||||||
} else {
|
} else {
|
||||||
|
@ -454,7 +451,6 @@ class Adminer {
|
||||||
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
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
echo '<p><a href="' . h(ME) . 'create=">' . lang('Create new table') . "</a>\n";
|
echo '<p><a href="' . h(ME) . 'create=">' . lang('Create new table') . "</a>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue