1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-16 11:34:10 +02:00

Save queries to history

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@654 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-06-04 14:00:23 +00:00
parent 622f6aaf56
commit 10bdbed14f
3 changed files with 8 additions and 5 deletions

View File

@@ -94,7 +94,11 @@ function redirect($location, $message = null) {
function query_redirect($query, $location, $message, $redirect = true, $execute = true, $failed = false) { function query_redirect($query, $location, $message, $redirect = true, $execute = true, $failed = false) {
global $dbh, $error, $SELF; global $dbh, $error, $SELF;
$id = "sql-" . count($_SESSION["messages"]); $id = "sql-" . count($_SESSION["messages"]);
$sql = ($query ? " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><span id='$id' class='hidden'><br /><code class='jush-sql'>" . htmlspecialchars($query) . '</code> <a href="' . htmlspecialchars($SELF) . 'sql=' . urlencode($query) . '">' . lang('Edit') . '</a></span>' : ""); $sql = "";
if ($query) {
$sql = " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><span id='$id' class='hidden'><br /><code class='jush-sql'>" . htmlspecialchars($query) . '</code> <a href="' . htmlspecialchars($SELF) . 'sql=&amp;history=' . count($_SESSION["history"]) . '">' . lang('Edit') . '</a></span>';
$_SESSION["history"][] = $query;
}
if ($execute) { if ($execute) {
$failed = !$dbh->query($query); $failed = !$dbh->query($query);
} }

View File

@@ -67,7 +67,7 @@ if (!$error && $_POST) {
?> ?>
<form action="" method="post"> <form action="" method="post">
<p><textarea name="query" rows="20" cols="80" style="width: 98%;"><?php echo htmlspecialchars($_POST ? $_POST["query"] : $_GET["sql"]); ?></textarea></p> <p><textarea name="query" rows="20" cols="80" style="width: 98%;"><?php echo htmlspecialchars($_POST ? $_POST["query"] : (strlen($_GET["history"]) ? $_SESSION["history"][$_GET["history"]] : $_GET["sql"])); ?></textarea></p>
<p> <p>
<input type="hidden" name="token" value="<?php echo $token; ?>" /> <input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="submit" value="<?php echo lang('Execute'); ?>" /> <input type="submit" value="<?php echo lang('Execute'); ?>" />

View File

@@ -1,4 +1,3 @@
Join repeated echo in _compile.php
Bulk database create and drop Bulk database create and drop
Add whisperer to fields with foreign key Add whisperer to fields with foreign key
Highlight found fields Highlight found fields
@@ -6,9 +5,9 @@ MySQL 5 BIT data type
Transactions in export Transactions in export
Compress export and import Compress export and import
Create view and routine options Create view and routine options
SQL queries history - utilize in edit link in .message and .error Visualize SQL queries history
Function to fix database encoding - http://php.vrana.cz/prevod-kodovani-mysql.php Function to fix database encoding - http://php.vrana.cz/prevod-kodovani-mysql.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
? Save uploaded files after error to session variable instead of hidden field ? Save uploaded files after error to session variable instead of hidden field
? Aliasing of built-in functions can save 7 KB, substitution of $_GET and friends can save 2 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB, JS shrink can save 1 KB ? Aliasing of built-in functions can save 7 KB, substitution of $_GET and friends can save 2 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB, JS packer can save 1 KB
? AJAX editing - select page has all data to display edit form ? AJAX editing - select page has all data to display edit form