bookmark sql query after checking errors
This commit is contained in:
parent
621280ec78
commit
4de7d3c83d
25
import.php
25
import.php
@ -241,31 +241,6 @@ if (isset($GLOBALS['show_as_php'])) {
|
||||
$go_sql = true;
|
||||
}
|
||||
|
||||
// Store the query as a bookmark before executing it if bookmarklabel was given
|
||||
if (! empty($bkm_label) && ! empty($import_text)) {
|
||||
include_once 'libraries/bookmark.lib.php';
|
||||
$bfields = array(
|
||||
'dbase' => $db,
|
||||
'user' => $cfg['Bookmark']['user'],
|
||||
'query' => urlencode($import_text),
|
||||
'label' => $bkm_label
|
||||
);
|
||||
|
||||
// Should we replace bookmark?
|
||||
if (isset($bkm_replace)) {
|
||||
$bookmarks = PMA_Bookmark_getList($db);
|
||||
foreach ($bookmarks as $key => $val) {
|
||||
if ($val == $bkm_label) {
|
||||
PMA_Bookmark_delete($db, $key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PMA_Bookmark_save($bfields, isset($bkm_all_users));
|
||||
|
||||
$bookmark_created = true;
|
||||
} // end store bookmarks
|
||||
|
||||
// We can not read all at once, otherwise we can run out of memory
|
||||
$memory_limit = trim(@ini_get('memory_limit'));
|
||||
// 2 MB as default
|
||||
|
||||
26
sql.php
26
sql.php
@ -574,6 +574,32 @@ if (isset($GLOBALS['show_as_php']) || ! empty($GLOBALS['validatequery'])) {
|
||||
}
|
||||
unset($error);
|
||||
|
||||
// If there are no errors and bookmarklabel was given,
|
||||
// store the query as a bookmark
|
||||
if (! empty($bkm_label) && ! empty($import_text)) {
|
||||
include_once 'libraries/bookmark.lib.php';
|
||||
$bfields = array(
|
||||
'dbase' => $db,
|
||||
'user' => $cfg['Bookmark']['user'],
|
||||
'query' => urlencode($import_text),
|
||||
'label' => $bkm_label
|
||||
);
|
||||
|
||||
// Should we replace bookmark?
|
||||
if (isset($bkm_replace)) {
|
||||
$bookmarks = PMA_Bookmark_getList($db);
|
||||
foreach ($bookmarks as $key => $val) {
|
||||
if ($val == $bkm_label) {
|
||||
PMA_Bookmark_delete($db, $key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PMA_Bookmark_save($bfields, isset($bkm_all_users));
|
||||
|
||||
$bookmark_created = true;
|
||||
} // end store bookmarks
|
||||
|
||||
// Gets the number of rows affected/returned
|
||||
// (This must be done immediately after the query because
|
||||
// mysql_affected_rows() reports about the last query done)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user