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) {
global $dbh, $error, $SELF;
$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) {
$failed = !$dbh->query($query);
}