some tweaks
display error on calling page instead an empty page
This commit is contained in:
@@ -16,9 +16,11 @@ if (! empty($submit_mult)
|
|||||||
|| ! empty($rows_to_delete))) {
|
|| ! empty($rows_to_delete))) {
|
||||||
define('PMA_SUBMIT_MULT', 1);
|
define('PMA_SUBMIT_MULT', 1);
|
||||||
if (isset($selected_db) && !empty($selected_db)) {
|
if (isset($selected_db) && !empty($selected_db)) {
|
||||||
|
// coming from server database view - do something with selected databases
|
||||||
$selected = $selected_db;
|
$selected = $selected_db;
|
||||||
$what = 'drop_db';
|
$what = 'drop_db';
|
||||||
} elseif (isset($selected_tbl) && !empty($selected_tbl)) {
|
} elseif (isset($selected_tbl) && !empty($selected_tbl)) {
|
||||||
|
// coming from database structure view - do something with selected tables
|
||||||
if ($submit_mult == $strPrintView) {
|
if ($submit_mult == $strPrintView) {
|
||||||
require './tbl_printview.php';
|
require './tbl_printview.php';
|
||||||
} else {
|
} else {
|
||||||
@@ -56,6 +58,7 @@ if (! empty($submit_mult)
|
|||||||
} // end switch
|
} // end switch
|
||||||
}
|
}
|
||||||
} elseif (isset($selected_fld) && !empty($selected_fld)) {
|
} elseif (isset($selected_fld) && !empty($selected_fld)) {
|
||||||
|
// coming from table structure view - do something with selected columns/fileds
|
||||||
$selected = $selected_fld;
|
$selected = $selected_fld;
|
||||||
switch ($submit_mult) {
|
switch ($submit_mult) {
|
||||||
case $strDrop:
|
case $strDrop:
|
||||||
@@ -105,6 +108,7 @@ if (! empty($submit_mult)
|
|||||||
// this should already be handled by tbl_structure.php
|
// this should already be handled by tbl_structure.php
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// coming from borwsing - do something with selected rows
|
||||||
$what = 'row_delete';
|
$what = 'row_delete';
|
||||||
$selected = $rows_to_delete;
|
$selected = $rows_to_delete;
|
||||||
}
|
}
|
||||||
@@ -188,15 +192,11 @@ if (!empty($submit_mult) && !empty($what)) {
|
|||||||
case 'drop_fld':
|
case 'drop_fld':
|
||||||
if ($full_query == '') {
|
if ($full_query == '') {
|
||||||
$full_query .= 'ALTER TABLE '
|
$full_query .= 'ALTER TABLE '
|
||||||
. PMA_backquote(htmlspecialchars($table))
|
. PMA_backquote(htmlspecialchars($table));
|
||||||
. '<br /> DROP '
|
}
|
||||||
. PMA_backquote(htmlspecialchars(urldecode($sval)))
|
|
||||||
. ',';
|
|
||||||
} else {
|
|
||||||
$full_query .= '<br /> DROP '
|
$full_query .= '<br /> DROP '
|
||||||
. PMA_backquote(htmlspecialchars(urldecode($sval)))
|
. PMA_backquote(htmlspecialchars(urldecode($sval)))
|
||||||
. ',';
|
. ',';
|
||||||
}
|
|
||||||
if ($i == $selected_cnt - 1) {
|
if ($i == $selected_cnt - 1) {
|
||||||
$full_query = preg_replace('@,$@', ';<br />', $full_query);
|
$full_query = preg_replace('@,$@', ';<br />', $full_query);
|
||||||
}
|
}
|
||||||
@@ -217,7 +217,7 @@ if (!empty($submit_mult) && !empty($what)) {
|
|||||||
// Displays the confirmation form
|
// Displays the confirmation form
|
||||||
$_url_params = array(
|
$_url_params = array(
|
||||||
'query_type' => $what,
|
'query_type' => $what,
|
||||||
'reload' => (isset($reload) ? PMA_sanitize($reload) : 0),
|
'reload' => (! empty($reload) ? 1 : 0),
|
||||||
);
|
);
|
||||||
if (strpos(' ' . $action, 'db_') == 1) {
|
if (strpos(' ' . $action, 'db_') == 1) {
|
||||||
$_url_params['db']= $db;
|
$_url_params['db']= $db;
|
||||||
@@ -386,7 +386,7 @@ elseif ($mult_btn == $strYes) {
|
|||||||
if ($query_type != 'drop_db') {
|
if ($query_type != 'drop_db') {
|
||||||
PMA_DBI_select_db($db);
|
PMA_DBI_select_db($db);
|
||||||
}
|
}
|
||||||
$result = @PMA_DBI_query($a_query) or PMA_mysqlDie('', $a_query, FALSE, $err_url);
|
$result = PMA_DBI_query($a_query);
|
||||||
} // end if
|
} // end if
|
||||||
} // end for
|
} // end for
|
||||||
|
|
||||||
@@ -403,12 +403,16 @@ elseif ($mult_btn == $strYes) {
|
|||||||
require './sql.php';
|
require './sql.php';
|
||||||
} elseif (!$run_parts) {
|
} elseif (!$run_parts) {
|
||||||
PMA_DBI_select_db($db);
|
PMA_DBI_select_db($db);
|
||||||
$result = PMA_DBI_query($sql_query);
|
$result = PMA_DBI_try_query($sql_query);
|
||||||
if (!empty($sql_query_views)) {
|
if ($result && !empty($sql_query_views)) {
|
||||||
$sql_query .= ' ' . $sql_query_views . ';';
|
$sql_query .= ' ' . $sql_query_views . ';';
|
||||||
PMA_DBI_query($sql_query_views);
|
$result = PMA_DBI_try_query($sql_query_views);
|
||||||
unset($sql_query_views);
|
unset($sql_query_views);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $result) {
|
||||||
|
$message = PMA_Message::error(PMA_DBI_getError());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($rebuild_database_list) {
|
if ($rebuild_database_list) {
|
||||||
// avoid a problem with the database list navigator
|
// avoid a problem with the database list navigator
|
||||||
|
Reference in New Issue
Block a user