<?php my $count = 0;$search->execute;while (my $log = $search->fetch){ $count++; next if ($count < $start); last if ($count > $finish); ?>