in reply to MySQL / Perl Question

While it is not always guaranteed with all databases, I believe MySQL supports $sth->rows So you just haveto do:
my $query = 'SELECT a_column from table"; my $dbh = however_you_connect; my $sth =$dbh->do($query); my $rows_per_page = 10; my $pages = $sth->rows / $rows_per_page;
Also, DBIx::Recordset has support for generating this the HTML navigation code, complete with embedded previous-next query bind parms.

Replies are listed 'Best First'.
Re: Re: MySQL / Perl Question
by Anonymous Monk on Nov 10, 2001 at 21:33 UTC
    thanks a lot, using that count number i can divide it by /30 which gives me the number of page, like 2.3 so that would be 3 pages (2 and a bit) but how can i use that number, say 45 to generate this html: e.g. << 1 .. 2...3 >>
      oh good point, use int() to force it into integer