From aa674afb6578e9b3f2d332d8290563be72994175 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 2 Aug 2003 00:53:02 +0000 Subject: [PATCH] next 20 results svn path=/trunk/boinc/; revision=1961 --- html/user/results_host.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/html/user/results_host.php b/html/user/results_host.php index b42be2e000..a080acefe0 100644 --- a/html/user/results_host.php +++ b/html/user/results_host.php @@ -4,17 +4,28 @@ require_once("util.inc"); require_once("result.inc"); + $results_per_page = 20; + db_init(); $hostid = $_GET["hostid"]; + $offset = $_GET["offset"]; + if (!$offset) $offset=0; page_head("Results for host"); result_table_start(); $i = 1; - $result = mysql_query("select * from result where hostid=$hostid order by id desc limit 20"); + $result = mysql_query("select * from result where hostid=$hostid order by id desc limit $results_per_page offset $offset"); while ($res = mysql_fetch_object($result)) { show_result_row($res, $i); $i++; } mysql_free_result($result); echo "\n"; + if ($i > $results_per_page) { + $offset = $offset+$results_per_page; + echo " +
Next $results_per_page results
+ "; + } + page_tail(); ?>