From fedefef85c1af91e7f60bae52c409db7dca623ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 13 Jun 2011 14:49:45 +0200 Subject: [PATCH] Properly handle case when there is no database selected --- libraries/display_tbl.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 5b06b3e26e..26d362d79f 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -2358,8 +2358,12 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) { * first table of this database, so that tbl_export.php and * the script it calls do not fail */ - if (empty($_url_params['table'])) { + if (empty($_url_params['table']) && !empty($_url_params['db'])) { $_url_params['table'] = PMA_DBI_fetch_value("SHOW TABLES"); + /* No result (probably no database selected) */ + if ($_url_params['table'] === FALSE) { + unset($_url_params['table']); + } } echo PMA_linkOrButton(