LIMIT separator
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1494 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
4595348a14
commit
99a643b86e
|
@ -251,7 +251,7 @@ if (isset($_GET["mssql"])) {
|
||||||
return get_vals("EXEC sp_databases");
|
return get_vals("EXEC sp_databases");
|
||||||
}
|
}
|
||||||
|
|
||||||
function limit($query, $limit, $offset = 0) {
|
function limit($query, $limit, $offset = 0, $separator = " ") {
|
||||||
return (isset($limit) ? " TOP (" . ($limit + $offset) . ")" : "") . " $query"; // seek later
|
return (isset($limit) ? " TOP (" . ($limit + $offset) . ")" : "") . " $query"; // seek later
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -260,10 +260,11 @@ if (!defined("DRIVER")) {
|
||||||
* @param string everything after SELECT
|
* @param string everything after SELECT
|
||||||
* @param int
|
* @param int
|
||||||
* @param int
|
* @param int
|
||||||
|
* @param string
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function limit($query, $limit, $offset = 0) {
|
function limit($query, $limit, $offset = 0, $separator = " ") {
|
||||||
return " $query" . (isset($limit) ? "\nLIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
return " $query" . (isset($limit) ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Formulate SQL modification query with limit 1
|
/** Formulate SQL modification query with limit 1
|
||||||
|
|
|
@ -163,8 +163,8 @@ if (isset($_GET["pgsql"])) {
|
||||||
return get_vals("SELECT datname FROM pg_database");
|
return get_vals("SELECT datname FROM pg_database");
|
||||||
}
|
}
|
||||||
|
|
||||||
function limit($query, $limit, $offset = 0) {
|
function limit($query, $limit, $offset = 0, $separator = " ") {
|
||||||
return " $query" . (isset($limit) ? "\nLIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
return " $query" . (isset($limit) ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
function limit1($query) {
|
function limit1($query) {
|
||||||
|
|
|
@ -211,8 +211,8 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
function limit($query, $limit, $offset = 0) {
|
function limit($query, $limit, $offset = 0, $separator = " ") {
|
||||||
return " $query" . (isset($limit) ? "\nLIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
return " $query" . (isset($limit) ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
function limit1($query) {
|
function limit1($query) {
|
||||||
|
|
|
@ -197,7 +197,7 @@ if (!$columns) {
|
||||||
$page = floor(($found_rows - 1) / $limit);
|
$page = floor(($found_rows - 1) / $limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = "SELECT" . limit((intval($limit) && $group && count($group) < count($select) && $driver == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . $from . $group_by, ($limit != "" ? intval($limit) : null), ($page ? $limit * $page : 0));
|
$query = "SELECT" . limit((intval($limit) && $group && count($group) < count($select) && $driver == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . $from . $group_by, ($limit != "" ? intval($limit) : null), ($page ? $limit * $page : 0), "\n");
|
||||||
echo $adminer->selectQuery($query);
|
echo $adminer->selectQuery($query);
|
||||||
|
|
||||||
$result = $connection->query($query);
|
$result = $connection->query($query);
|
||||||
|
|
Loading…
Reference in a new issue