diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 9d803444..9e9f8070 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -441,16 +441,20 @@ class Adminer { query("SHOW TABLES"); - if (!$result->num_rows) { - echo "

" . lang('No tables.') . "\n"; + if (!$result) { + 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 + 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 + } } + $result->free(); } - $result->free(); echo '

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