next 20 results

svn path=/trunk/boinc/; revision=1961
This commit is contained in:
David Anderson 2003-08-02 00:53:02 +00:00
parent a85fe7ec95
commit aa674afb65
1 changed files with 12 additions and 1 deletions

View File

@ -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 "</table>\n";
if ($i > $results_per_page) {
$offset = $offset+$results_per_page;
echo "
<br><center><a href=results_host.php?hostid=$hostid&offset=$offset>Next $results_per_page results</a></center>
";
}
page_tail();
?>