Print SQL query by messages

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@480 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2008-09-03 09:35:12 +00:00
parent c48a017e0e
commit 06faef23e7
4 changed files with 13 additions and 2 deletions

View File

@@ -197,7 +197,8 @@ function redirect($location, $message = null) {
function query_redirect($query, $location, $message, $redirect = true, $execute = true) {
global $mysql, $error, $SELF;
$sql = ' <a href="' . htmlspecialchars($SELF) . 'sql=' . urlencode($query) . '">' . lang('SQL command') . "</a>";
$id = "sql-" . count($_SESSION["messages"]);
$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=' . urlencode($query) . '">' . lang('Edit') . '</a></span>';
if ($execute && !$mysql->query($query)) {
$error = htmlspecialchars($mysql->error) . $sql;
return false;