export nothing if no tables are selected

This commit is contained in:
Marc Delisle
2006-10-17 17:10:40 +00:00
parent bc42b28304
commit 3cd881c9e3
3 changed files with 21 additions and 28 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - ChangeLog
$Id$
$HeadURL$
2006-10-17 Marc Delisle <lem9@users.sourceforge.net>
* export.php: export nothing if no tables are selected
2006-10-17 Michal Čihař <michal@cihar.com>
* Documentation.html: Fix HTML errors.
* libraries/sqlparser.data.php, libraries/sqlparser.lib.php: Add support

View File

@@ -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 {

View File

@@ -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';