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,19 +440,15 @@ 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) {
|
if (!$result->num_rows) {
|
||||||
echo "<p class='error'>" . lang('No tables.') . "\n";
|
echo "<p class='message'>" . lang('No tables.') . "\n";
|
||||||
} else {
|
} else {
|
||||||
if (!$result->num_rows) {
|
echo "<p id='tables'>\n";
|
||||||
echo "<p class='message'>" . lang('No tables.') . "\n";
|
while ($row = $result->fetch_row()) {
|
||||||
} else {
|
echo '<a href="' . h(ME) . 'select=' . urlencode($row[0]) . '">' . lang('select') . '</a> ';
|
||||||
echo "<p id='tables'>\n";
|
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
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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