http://www.perlmonks.org?node_id=28162

Kiko has asked for the wisdom of the Perl Monks concerning the following question:

Hey, I left this program alone for a while and now i'm working on it again. I'm trying to view the first 100 records from a database and then display the next 100 and so on. I'm able to display the first 100 but i don't know how to show the next 100. This is the section of my program that's supposed to do this: my ($row)=0; my ($count)=0; my ($min)=0; my ($max)=$min+100; while ($db->FetchRow()) { if(($row>=$min)&&($row<$max)) { my (%dbrow) = $db->DataHash(); $dbrow{'details'}=substr($dbrow{'details'},0,50); print<<HERE_HTML_ROW; <td bgcolor="$recordbg"><font face="arial" size="1">$dbrow{'la +stname'},&nbsp;$dbrow{'firstname'}&nbsp;</font>&nbsp;</td> <td bgcolor="$recordbg"><font face="arial" size="1">$dbrow{'of +ficephonenumber'}&nbsp;</font>&nbsp;</td> <td bgcolor="$recordbg"><font face="arial" size="1">$dbrow{'de +scription'}&nbsp;</font>&nbsp;</td> <td bgcolor="$recordbg"><font face="arial" size="1">$company_t +ype&nbsp;</font>&nbsp;</td> <td bgcolor="$recordbg"><font face="arial" size="1">$dbrow{'co +mpany_name'}&nbsp;</font>&nbsp;</td> <td bgcolor="$recordbg"><font face="arial" size="1">$dbrow{'de +tails'}&nbsp;</font>&nbsp;</td> HERE_HTML_ROW print "\n</tr>\n"; } $row++; $count++; } print "\n</table>\n"; my ($visible); if ($count>=$max){ $visible=$max; } else { $visible=$count; } print<<HERE_HTML; <BR><font size="2" face="helvetica"><B>1-$visible of $count records di +splayed</B></font> HERE_HTML # This is the part that's not working because i don't think # that i can do this, please help. if ($row>$max) { print "<font size=2 face=helvetica><a href=\"$ENV{'SCRIPT_NAME'}?$ +ENV{'QUERY_STRING'}&min=100\">Next 100</a></font>\n"; } Thanks, Kiko