diff --git a/ChangeLog b/ChangeLog index 372dc57fc..a8272da41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - ChangeLog $Id$ $HeadURL$ +2006-10-17 Marc Delisle + * export.php: export nothing if no tables are selected + 2006-10-17 Michal Čihař * Documentation.html: Fix HTML errors. * libraries/sqlparser.data.php, libraries/sqlparser.lib.php: Add support diff --git a/export.php b/export.php index 5c57fadd8..8202a62da 100644 --- a/export.php +++ b/export.php @@ -337,6 +337,23 @@ if (!$save_on_server) { } } else { // HTML + // Check if we have something to export + if ($export_type == 'database') { + if (isset($table_select)) { + $tables = $table_select; + } else { + $tables = array(); + } + $num_tables = count($tables); + if ($num_tables == 0) { + $message = $strNoTablesFound; + $js_to_run = 'functions.js'; + require_once('./libraries/header.inc.php'); + $active_page = 'db_details_export.php'; + require('./db_details_export.php'); + exit(); + } + } $backup_cfgServer = $cfg['Server']; require_once('./libraries/header.inc.php'); $cfg['Server'] = $backup_cfgServer; @@ -352,33 +369,6 @@ if (!$save_on_server) { } // end download } -// Check if we have something to export -if ($export_type == 'database') { - if (isset($table_select)) { - $tables = $table_select; - } else { - // not sure if this can happen, let's play safe - $tables = PMA_DBI_get_tables($db); - } - $num_tables = count($tables); - if ($num_tables == 0) { - $message = $strNoTablesFound; - $js_to_run = 'functions.js'; - require_once('./libraries/header.inc.php'); - //if ($export_type == 'server') { - // $active_page = 'server_export.php'; - // require('./server_export.php'); - //} elseif ($export_type == 'database') { - $active_page = 'db_details_export.php'; - require('./db_details_export.php'); - //} else { - // $active_page = 'tbl_properties_export.php'; - // require('./tbl_properties_export.php'); - //} - exit(); - } -} - // Fake loop just to allow skip of remain of this code by break, I'd really // need exceptions here :-) do { diff --git a/libraries/Table.class.php b/libraries/Table.class.php index 45eca9979..da15225f5 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -669,7 +669,7 @@ class PMA_Table { // moving table from replicated one to not replicated one PMA_DBI_select_db($source_db); - if (PMA_Table::_isView($source_db,$source)) { + if (PMA_Table::_isView($source_db,$source_table)) { $sql_drop_query = 'DROP VIEW'; } else { $sql_drop_query = 'DROP TABLE';