List,

I have the following code here....

my $sth = $dbh ->prepare( qq{ SELECT * FROM
                                table_name
                                WHERE status <> 'DELETED' AND status <>
'COMPLETE'
                                ORDER BY status
                               } ) || die $dbh->errstr; ;
  $sth->execute;
  my $entries;
  my $truth = $sth->rows;
  if ($truth == 0 ){
        print<<HTML;
        NO DATA IN DATABASE
HTML
        }elsif ($truth >= 1 ){
        print<<HTML
        THERE ARE $truth ROWS IN THE DATABASE!
HTML
}


Now what I really want to be able to do is only display 10 of the rows in
the database then create a hyperlink to to the next 10 and so on.

  my $truth = $sth->rows;
  if ($truth == 0 ){
        print<<HTML;
        NO DATA IN DATABASE
HTML
        }elsif ($truth >= 1 BUT LESS THAN 10 ){
        print<<HTML
        THERE ARE $truth ROWS IN THE DATABASE!
        PLEASE PRESS HERE TO SEE THE NEXT 10 ENTRIES ($hyperlink)
HTML
        }elsif ($truth >= 11 BUT LESS THAN 20)
        print<<HTML
        SELECT HERE TO SEE NEXT 10 ENTRIES IN DATABASE
        <a href="link.cgi?show_next=next)
        }

Does this make sense to any one.  I have been 'straining' my brain for a
couple of days on this one.

Kind regards,

Daniel Falkenberg

==============================
VINTEK CONSULTING PTY LTD
(ACN 088 825 209)
Email:  [EMAIL PROTECTED]
WWW:    http://www.vintek.net
Tel:    (08) 8523 5035
Fax:    (08) 8523 2104
Snail:  P.O. Box 312
        Gawler   SA   5118
==============================


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to