]> git.joonet.de Git - adminer.git/commitdiff
Print SQL query (fixes #2082448)
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 1 Sep 2008 12:22:26 +0000 (12:22 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 1 Sep 2008 12:22:26 +0000 (12:22 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@470 7c3ca157-0c34-0410-bff1-cbf682f78f5c

design.inc.php
select.inc.php
todo.txt

index a9e3f9feeff7314a77ced3d195aea26d811a88fb..e0b3da840a9af64491fda28ec0d35c06a8ab182b 100644 (file)
@@ -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 } ?>
index f085be1dcd3908c47a496abf00d6943fd193c9f5..ad6d738e308b2884111b4543ed44ac249749ade4 100644 (file)
@@ -213,7 +213,10 @@ for (var i=0; <?php echo $i; ?> > i; i++) {
        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 @@ for (var i=0; <?php echo $i; ?> > i; i++) {
                                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 @@ for (var i=0; <?php echo $i; ?> > i; i++) {
                                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();
        }
index 669d32d1217df4a3c4d25d9a072e65fd0e23f3b6..ef9736704329fac5c0529f9b91f166488c31df3f 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -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