Print SQL query (fixes #2082448)

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@470 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2008-09-01 12:22:26 +00:00
parent aa9b2bc462
commit 8b745113e6
3 changed files with 11 additions and 5 deletions

View file

@ -109,6 +109,7 @@ function page_footer($missing = false) {
if (typeof jush != 'undefined') { if (typeof jush != 'undefined') {
jush.style('http://jush.sourceforge.net/jush.css'); jush.style('http://jush.sourceforge.net/jush.css');
jush.highlight_tag('pre'); jush.highlight_tag('pre');
jush.highlight_tag('code');
} }
</script> </script>
<?php } ?> <?php } ?>

View 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 "<fieldset><legend>" . lang('Action') . "</legend><input type='submit' value='" . lang('Select') . "' /></fieldset>\n";
echo "</form>\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) { if (!$result) {
echo "<p class='error'>" . htmlspecialchars($mysql->error) . "</p>\n"; echo "<p class='error'>" . htmlspecialchars($mysql->error) . "</p>\n";
} else { } else {
@ -271,9 +274,6 @@ for (var i=0; <?php echo $i; ?> > i; i++) {
echo "</tr>\n"; echo "</tr>\n";
} }
echo "</table>\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>"; 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); $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); print_page($max_page);
} }
echo " (" . lang('%d row(s)', $found_rows) . ")</p>\n"; 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(); $result->free();
} }

View file

@ -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 Save uploaded files after error to session variable instead of hidden field
Transactions in export Transactions in export
Compress export and import Compress export and import
? Query print Partitioning (MySQL 5.1)
Create view options
? Execution time in sql.inc.php ? Execution time in sql.inc.php
? Save token also to cookie - for session expiration and login in other window ? Save token also to cookie - for session expiration and login in other window