Print SQL query by message

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@477 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2008-09-02 08:42:14 +00:00
parent aa5a11907a
commit f91b2c4bed
12 changed files with 52 additions and 73 deletions

View File

@@ -195,6 +195,14 @@ function redirect($location, $message = null) {
exit;
}
function query_redirect($query, $location, $message) {
global $mysql, $error, $SELF;
if ($mysql->query($query)) {
redirect($location, $message . "<br /><code class='jush-sql'>" . htmlspecialchars($query) . '</code> - <a href="' . htmlspecialchars($SELF) . 'sql=' . urlencode($query) . '">' . lang('edit') . '</a>');
}
$error = $mysql->error;
}
function remove_from_uri($param = "") {
$param = "($param|" . session_name() . ")";
return preg_replace("~\\?$param=[^&]*&~", '?', preg_replace("~\\?$param=[^&]*\$|&$param=[^&]*~", '', $_SERVER["REQUEST_URI"]));