Permalink
Browse files

Print SQL query (fixes #2082448)

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@470 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent aa9b2bc commit 8b745113e607cfa71dc80a76c8884831a487ee44 jakubvrana committed Sep 1, 2008
Showing with 11 additions and 5 deletions.
  1. +1 −0 design.inc.php
  2. +8 −4 select.inc.php
  3. +2 −1 todo.txt
View
@@ -109,6 +109,7 @@ function page_footer($missing = false) {
if (typeof jush != 'undefined') {
jush.style('http://jush.sourceforge.net/jush.css');
jush.highlight_tag('pre');
+ jush.highlight_tag('code');
}
</script>
<?php } ?>
View
@@ -213,7 +213,10 @@ function where_change(op) {
echo "<fieldset><legend>" . lang('Action') . "</legend><input type='submit' value='" . lang('Select') . "' /></fieldset>\n";
echo "</form>\n";
- $result = $mysql->query("SELECT " . ($select ? (count($group) < count($select) ? "SQL_CALC_FOUND_ROWS " : "") . implode(", ", $select) : "*") . " $from");
+ $query = "SELECT " . ($select ? (count($group) < count($select) ? "SQL_CALC_FOUND_ROWS " : "") . implode(", ", $select) : "*") . " $from";
+ echo "<p><code class='jush-sql'>" . htmlspecialchars($query) . "</code> - <a href='" . htmlspecialchars($SELF) . "sql=" . urlencode($query) . "'>" . lang('edit') . "</a></p>\n";
+
+ $result = $mysql->query($query);
if (!$result) {
echo "<p class='error'>" . htmlspecialchars($mysql->error) . "</p>\n";
} else {
@@ -271,9 +274,6 @@ function where_change(op) {
echo "</tr>\n";
}
echo "</table>\n";
- echo "<fieldset><legend>" . lang('Delete') . "</legend><input type='hidden' name='token' value='$token' />" . (count($group) == count($select) ? "<input type='submit' value='" . lang('Delete selected') . "' /> " : "") . "<input type='submit' name='truncate' value='" . lang('Truncate result') . "' onclick=\"return confirm('" . lang('Are you sure?') . "');\" /></fieldset>\n";
- echo "<fieldset><legend>" . lang('Export') . "</legend>$dump_options " . (count($group) == count($select) ? "<input type='submit' name='export' value='" . lang('Export selected') . "' /> " : "") . "<input type='submit' name='export_result' value='" . lang('Export result') . "' /></fieldset>\n"; //! output, format
- echo "</form>\n";
echo "<p>";
$found_rows = (intval($limit) ? $mysql->result($mysql->query(count($group) < count($select) ? " SELECT FOUND_ROWS()" : "SELECT COUNT(*) FROM " . idf_escape($_GET["select"]) . ($where ? " WHERE " . implode(" AND ", $where) : ""))) : $result->num_rows);
@@ -293,6 +293,10 @@ function where_change(op) {
print_page($max_page);
}
echo " (" . lang('%d row(s)', $found_rows) . ")</p>\n";
+
+ echo "<fieldset><legend>" . lang('Delete') . "</legend><input type='hidden' name='token' value='$token' />" . (count($group) == count($select) ? "<input type='submit' value='" . lang('Delete selected') . "' /> " : "") . "<input type='submit' name='truncate' value='" . lang('Truncate result') . "' onclick=\"return confirm('" . lang('Are you sure?') . "');\" /></fieldset>\n";
+ echo "<fieldset><legend>" . lang('Export') . "</legend>$dump_options " . (count($group) == count($select) ? "<input type='submit' name='export' value='" . lang('Export selected') . "' /> " : "") . "<input type='submit' name='export_result' value='" . lang('Export result') . "' /></fieldset>\n"; //! output, format
+ echo "</form>\n";
}
$result->free();
}
View
@@ -9,6 +9,7 @@ Bulk update - leave original, set to value, set to NULL
Save uploaded files after error to session variable instead of hidden field
Transactions in export
Compress export and import
-? Query print
+Partitioning (MySQL 5.1)
+Create view options
? Execution time in sql.inc.php
? Save token also to cookie - for session expiration and login in other window

0 comments on commit 8b74511

Please sign in to comment.