1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-29 01:00:07 +02:00

Separate $where in limit function

This commit is contained in:
Jakub Vrana
2010-05-14 15:51:54 +02:00
parent 8b2808ab99
commit ee3e04590a
10 changed files with 45 additions and 40 deletions

View File

@@ -266,21 +266,22 @@ if (!defined("DRIVER")) {
/** Formulate SQL query with limit
* @param string everything after SELECT
* @param string including WHERE
* @param int
* @param int
* @param string
* @return string
*/
function limit($query, $limit, $offset = 0, $separator = " ") {
return " $query" . (isset($limit) ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
function limit($query, $where, $limit, $offset = 0, $separator = " ") {
return " $query$where" . (isset($limit) ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
}
/** Formulate SQL modification query with limit 1
* @param string everything after UPDATE or DELETE
* @return string
*/
function limit1($query) {
return limit($query, 1);
function limit1($query, $where) {
return limit($query, $where, 1);
}
/** Get database collation