From 170b674a0953ce95e06f7a8442eb0f1097e7ee72 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 16 Mar 2003 07:02:20 +0000 Subject: - All LIMIT queries must go through the pager or through db_query_range(). The syntax for db_query_range() was enhanced so it matches db_query(). So you may pass extra arguments of the SQL statement which are checked via check_query() and then substituted into the SQL statement. After these optional arguments, you always pass $from and $count parameters which define your range. Most often, the $from is 0 and the count is the max number of records you want returned. Patch by Moshe. - The pager_query() function for PEAR was enhanced so that it adds proper GROUP BY statement counting the number of records to be paged. Patch by James Arthur. - MSSQL database scheme by Moshe. --- modules/archive/archive.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/archive/archive.module') diff --git a/modules/archive/archive.module b/modules/archive/archive.module index 6395c693d..be3555d14 100644 --- a/modules/archive/archive.module +++ b/modules/archive/archive.module @@ -174,7 +174,7 @@ function archive_page() { */ if ($year && $month && $day) { - $result = db_query("SELECT nid FROM node WHERE status = '1' AND created > %d ORDER BY created LIMIT 20", $date); + $result = db_query_range("SELECT nid FROM node WHERE status = '1' AND created > %d ORDER BY created", $date, 0, 20); while ($nid = db_fetch_object($result)) { node_view(node_load(array("nid" => $nid->nid)), 1); -- cgit v1.2.3