mirror of
https://github.com/vrana/adminer.git
synced 2025-08-12 01:24:17 +02:00
Wrap SQL query
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1343 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -126,7 +126,7 @@ class Adminer {
|
||||
* @return string
|
||||
*/
|
||||
function selectQuery($query) {
|
||||
return "<p><code class='jush-sql'>" . h($query) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
|
||||
return "<p><code class='jush-sql'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
|
||||
}
|
||||
|
||||
/** Description of a row in a table
|
||||
|
@@ -23,8 +23,8 @@ list($select, $group) = $adminer->selectColumnsProcess($columns, $indexes);
|
||||
$where = $adminer->selectSearchProcess($fields, $indexes);
|
||||
$order = $adminer->selectOrderProcess($fields, $indexes);
|
||||
$limit = $adminer->selectLimitProcess();
|
||||
$from = ($select ? implode(", ", $select) : "*") . " FROM " . idf_escape($TABLE) . ($where ? " WHERE " . implode(" AND ", $where) : "");
|
||||
$group_by = ($group && count($group) < count($select) ? " GROUP BY " . implode(", ", $group) : "") . ($order ? " ORDER BY " . implode(", ", $order) : "");
|
||||
$from = ($select ? implode(", ", $select) : "*") . "\nFROM " . idf_escape($TABLE) . ($where ? "\nWHERE " . implode(" AND ", $where) : "");
|
||||
$group_by = ($group && count($group) < count($select) ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : "");
|
||||
|
||||
if ($_POST && !$error) {
|
||||
$where_check = "(" . implode(") OR (", array_map('where_check', (array) $_POST["check"])) . ")";
|
||||
@@ -163,7 +163,7 @@ if (!$columns) {
|
||||
$adminer->selectActionPrint($text_length);
|
||||
echo "</form>\n";
|
||||
|
||||
$query = "SELECT " . (intval($limit) && $group && count($group) < count($select) ? "SQL_CALC_FOUND_ROWS " : "") . $from . $group_by . ($limit != "" ? " LIMIT " . intval($limit) . ($_GET["page"] ? " OFFSET " . ($limit * $_GET["page"]) : "") : "");
|
||||
$query = "SELECT " . (intval($limit) && $group && count($group) < count($select) ? "SQL_CALC_FOUND_ROWS " : "") . $from . $group_by . ($limit != "" ? "\nLIMIT " . intval($limit) . ($_GET["page"] ? " OFFSET " . ($limit * $_GET["page"]) : "") : "");
|
||||
echo $adminer->selectQuery($query);
|
||||
|
||||
$result = $connection->query($query);
|
||||
|
@@ -105,7 +105,7 @@ ORDER BY ORDINAL_POSITION");
|
||||
}
|
||||
|
||||
function selectQuery($query) {
|
||||
return "<!-- " . str_replace("--", "--><!--", $query) . " -->\n";
|
||||
return "<!--\n" . str_replace("--", "--><!--", $query) . "\n-->\n";
|
||||
}
|
||||
|
||||
function rowDescription($table) {
|
||||
|
Reference in New Issue
Block a user