From 176d1c1202c5a45db7edc94f2c29b66a87544f36 Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Fri, 11 Jun 2004 16:37:15 +0000 Subject: [PATCH] use wfLimitResult --- includes/QueryPage.php | 2 +- includes/SpecialAllpages.php | 4 ++-- includes/SpecialUnusedimages.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/QueryPage.php b/includes/QueryPage.php index 6ffd116623..43804cee26 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -37,7 +37,7 @@ class QueryPage { function getOrderLimit( $offset, $limit ) { return " ORDER BY value " . ($this->sortDescending() ? "DESC" : "") - . " LIMIT {$offset}, {$limit}"; + . wfLimitResult($limit,$offset); } # Is this query expensive (for some definition of expensive)? Then we diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index 67246e447f..ccac741ebd 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -52,7 +52,7 @@ function indexShowToplevel() # There's got to be a cleaner way to do this! for( $i = 1; $i < $sections; $i++ ) { $from = $i * $indexMaxperpage; - $sql = "SELECT cur_title $fromwhere $order LIMIT $from,2"; + $sql = "SELECT cur_title $fromwhere $order ".wfLimitResult(2,$from); $res = wfQuery( $sql, DB_READ, $fname ); $s = wfFetchObject( $res ); @@ -66,7 +66,7 @@ function indexShowToplevel() } $from = $i * $indexMaxperpage; - $sql = "SELECT cur_title $fromwhere $order LIMIT " . ($count-1) . ",1"; + $sql = "SELECT cur_title $fromwhere $order ".wfLimitResult(1,$count-1); $res = wfQuery( $sql, DB_READ, $fname ); $s = wfFetchObject( $res ); $outpoint = $s->cur_title; diff --git a/includes/SpecialUnusedimages.php b/includes/SpecialUnusedimages.php index 09075f5be1..4bc8d7bbf8 100644 --- a/includes/SpecialUnusedimages.php +++ b/includes/SpecialUnusedimages.php @@ -8,7 +8,7 @@ function wfSpecialUnusedimages() { $sql = "SELECT img_name,img_user,img_user_text,img_timestamp,img_description " . "FROM image LEFT JOIN imagelinks ON img_name=il_to WHERE il_to IS NULL " . - "ORDER BY img_timestamp LIMIT {$offset}, {$limit}"; + "ORDER BY img_timestamp ".wfLimitResult($limit,$offset); $res = wfQuery( $sql, DB_READ, $fname ); $sk = $wgUser->getSkin(); -- 2.20.1