mirror of
https://github.com/vrana/adminer.git
synced 2026-03-03 19:11:30 +01: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:
@@ -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=&history=' . count($_SESSION["history"]) . '">' . lang('Edit') . '</a></span>';
|
||||
$_SESSION["history"][] = $query;
|
||||
}
|
||||
if ($execute) {
|
||||
$failed = !$dbh->query($query);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user