Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Marin <alex.ukf@gmail.com>2012-04-20 18:21:06 +0400
committerAlex Marin <alex.ukf@gmail.com>2012-04-20 18:21:06 +0400
commit4de7d3c83d7a8f0150cddef9dc38acd92f80fb7a (patch)
tree9aad98314e4222f889c8ce50a746201376f7fec0 /sql.php
parent621280ec78ce2cde95dc7bec1b915cf63550d9ae (diff)
bookmark sql query after checking errors
Diffstat (limited to 'sql.php')
-rw-r--r--sql.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/sql.php b/sql.php
index d474605e3c..4206c87f98 100644
--- a/sql.php
+++ b/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)