From: jakubvrana Date: Mon, 7 Sep 2009 13:59:17 +0000 (+0000) Subject: Select database before SHOW TABLES (bug #2853561) X-Git-Tag: v3.0.0~463 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=24fc853e7bb482bca13cd4d39dbb421c7d863948;p=adminer.git Select database before SHOW TABLES (bug #2853561) git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1070 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 2233032a..bcc5feed 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -440,19 +440,15 @@ class Adminer {

select_db(DB)) { $result = $dbh->query("SHOW TABLES"); - if (!$result) { - echo "

" . lang('No tables.') . "\n"; + if (!$result->num_rows) { + echo "

" . lang('No tables.') . "\n"; } else { - if (!$result->num_rows) { - echo "

" . lang('No tables.') . "\n"; - } else { - echo "

\n"; - while ($row = $result->fetch_row()) { - echo '' . lang('select') . ' '; - echo '' . $this->tableName(array("Name" => $row[0])) . "
\n"; //! Adminer::tableName may work with full table status - } + echo "

\n"; + while ($row = $result->fetch_row()) { + echo '' . lang('select') . ' '; + echo '' . $this->tableName(array("Name" => $row[0])) . "
\n"; //! Adminer::tableName may work with full table status } } echo '

' . lang('Create new table') . "\n";