RFE #470000 - Use parameters for bookmarked queries.

This commit is contained in:
Garvin Hicking
2003-03-12 18:05:38 +00:00
parent 61bd5043f3
commit 4f4c295522
4 changed files with 13 additions and 2 deletions

View File

@@ -6,6 +6,12 @@ $Id$
$Source$ $Source$
2003-03-12 Garvin Hicking <me@supergarv.de> 2003-03-12 Garvin Hicking <me@supergarv.de>
* Documentation.html, db_details.php3, read_dump.php3, tbl_query_box.php3:
RFE #470000 - Use parameters for bookmarked queries. This is a bit tricky
to do, so please see Documentation.html. I thought it too hard to move the
bookmark-box around where you can store the bookmarks, because there are a couples
of redirections involved. So the major problem is that your to-be-stored bookmark
HAS to yield at least a single result row for you to be able to store that.
* tbl_move_copy.php3, tbl_properties_operations.php3: RFE #571838 : * tbl_move_copy.php3, tbl_properties_operations.php3: RFE #571838 :
Add 'DROP TABLE IF EXISTS' checkbox. Will maintain any existing PMA_* entries Add 'DROP TABLE IF EXISTS' checkbox. Will maintain any existing PMA_* entries
for that table. for that table.

View File

@@ -159,7 +159,8 @@ if ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table']) {
while (list($key, $value) = each($bookmark_list)) { while (list($key, $value) = each($bookmark_list)) {
echo ' <option value="' . $value . '">' . htmlentities($key) . '</option>' . "\n"; echo ' <option value="' . $value . '">' . htmlentities($key) . '</option>' . "\n";
} }
echo ' </select>' . "\n"; echo ' </select>' . "<br />\n";
echo ' ' . $strVar . ' (<a href="./Documentation.html#faqbookmark" target="documentation">' . $strDocu . '</a>): <input type="text" name="bookmark_variable" class="textfield" size="10" />' . "\n";
echo ' <input type="radio" name="action_bookmark" value="0" id="radio_bookmark0" checked="checked" style="vertical-align: middle" /><label for="radio_bookmark0">' . $strSubmit . '</label>' . "\n"; echo ' <input type="radio" name="action_bookmark" value="0" id="radio_bookmark0" checked="checked" style="vertical-align: middle" /><label for="radio_bookmark0">' . $strSubmit . '</label>' . "\n";
echo ' &nbsp;<input type="radio" name="action_bookmark" value="1" id="radio_bookmark1" style="vertical-align: middle" /><label for="radio_bookmark1">' . $strBookmarkView . '</label>' . "\n"; echo ' &nbsp;<input type="radio" name="action_bookmark" value="1" id="radio_bookmark1" style="vertical-align: middle" /><label for="radio_bookmark1">' . $strBookmarkView . '</label>' . "\n";
echo ' &nbsp;<input type="radio" name="action_bookmark" value="2" id="radio_bookmark2" style="vertical-align: middle" /><label for="radio_bookmark2">' . $strDelete . '</label>' . "\n"; echo ' &nbsp;<input type="radio" name="action_bookmark" value="2" id="radio_bookmark2" style="vertical-align: middle" /><label for="radio_bookmark2">' . $strDelete . '</label>' . "\n";

View File

@@ -49,6 +49,9 @@ if (!empty($id_bookmark)) {
switch ($action_bookmark) { switch ($action_bookmark) {
case 0: // bookmarked query that have to be run case 0: // bookmarked query that have to be run
$sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark); $sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark);
if (isset($bookmark_variable) && !empty($bookmark_variable)) {
$sql_query = preg_replace('|/\*(.*)\[VARIABLE\](.*)\*/|imsU', '${1}' . PMA_sqlAddslashes($bookmark_variable) . '${2}', $sql_query);
}
break; break;
case 1: // bookmarked query that have to be displayed case 1: // bookmarked query that have to be displayed
$sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark); $sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], $id_bookmark);

View File

@@ -194,7 +194,8 @@ if (!isset($is_inside_querywindow) ||
while (list($key, $value) = each($bookmark_list)) { while (list($key, $value) = each($bookmark_list)) {
echo ' <option value="' . $value . '">' . htmlentities($key) . '</option>' . "\n"; echo ' <option value="' . $value . '">' . htmlentities($key) . '</option>' . "\n";
} }
echo ' </select>' . "\n"; echo ' </select>' . "<br />\n";
echo ' ' . $strVar . ' (<a href="./Documentation.html#faqbookmark" target="documentation">' . $strDocu . '</a>): <input type="text" name="bookmark_variable" class="textfield" size="10" />' . "\n";
echo ' <input type="radio" name="action_bookmark" value="0" id="radio_bookmark0" checked="checked" style="vertical-align: middle" /><label for="radio_bookmark0">' . $strSubmit . '</label>' . "\n"; echo ' <input type="radio" name="action_bookmark" value="0" id="radio_bookmark0" checked="checked" style="vertical-align: middle" /><label for="radio_bookmark0">' . $strSubmit . '</label>' . "\n";
echo ' &nbsp;<input type="radio" name="action_bookmark" value="1" id="radio_bookmark1" style="vertical-align: middle" /><label for="radio_bookmark1">' . $strBookmarkView . '</label>' . "\n"; echo ' &nbsp;<input type="radio" name="action_bookmark" value="1" id="radio_bookmark1" style="vertical-align: middle" /><label for="radio_bookmark1">' . $strBookmarkView . '</label>' . "\n";
echo ' &nbsp;<input type="radio" name="action_bookmark" value="2" id="radio_bookmark2" style="vertical-align: middle" /><label for="radio_bookmark2">' . $strDelete . '</label>' . "\n"; echo ' &nbsp;<input type="radio" name="action_bookmark" value="2" id="radio_bookmark2" style="vertical-align: middle" /><label for="radio_bookmark2">' . $strDelete . '</label>' . "\n";