'
. __('MySQL said: ') . PMA_DBI_getError(null);
} else {
$result = PMA_DBI_try_query($item_query);
if (! $result) {
$errors[] = sprintf(
__('The following query has failed: "%s"'),
htmlspecialchars($item_query)
)
. '
'
. __('MySQL said: ') . PMA_DBI_getError(null);
// We dropped the old item, but were unable to create the new one
// Try to restore the backup query
$result = PMA_DBI_try_query($create_item);
if (! $result) {
// OMG, this is really bad! We dropped the query,
// failed to create a new one
// and now even the backup query does not execute!
// This should not happen, but we better handle
// this just in case.
$errors[] = __(
'Sorry, we failed to restore the dropped trigger.'
)
. '
'
. __('The backed up query was:')
. "\"" . htmlspecialchars($create_item) . "\""
. '
'
. __('MySQL said: ') . PMA_DBI_getError(null);
}
} else {
$message = PMA_Message::success(
__('Trigger %1$s has been modified.')
);
$message->addParam(
PMA_Util::backquote($_REQUEST['item_name'])
);
$sql_query = $drop_item . $item_query;
}
}
} else {
// 'Add a new item' mode
$result = PMA_DBI_try_query($item_query);
if (! $result) {
$errors[] = sprintf(
__('The following query has failed: "%s"'),
htmlspecialchars($item_query)
)
. '
'
. __('MySQL said: ') . PMA_DBI_getError(null);
} else {
$message = PMA_Message::success(
__('Trigger %1$s has been created.')
);
$message->addParam(
PMA_Util::backquote($_REQUEST['item_name'])
);
$sql_query = $item_query;
}
}
}
if (count($errors)) {
$message = PMA_Message::error(__('One or more errors have occured while processing your request:'));
$message->addString('