Splitting Records into HTML Pages from a database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dabella
    New Member
    • Mar 2010
    • 3

    Splitting Records into HTML Pages from a database

    Hello all, i'm would like to know if there is a method to split up records from a database into multiple HTML pages.
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    There are ways to do most anything you want. Can you post some samples of the data you are extracting and also explain what you are trying to do? Try to code it and if you get stuck, post your code here and we will help you, but you have to try to code it first.

    Regards,

    Jeff

    Comment

    • dabella
      New Member
      • Mar 2010
      • 3

      #3
      Code:
      #!/usr/bin/perl -w
      $|++;
      use strict;
      use DBI;
      use CGI;
      use POSIX;
      my $limit;
      if (!$limit) {
         $limit=0;
      my $dbh = DBI->connect($dbname, $dbusername, $dbpassword)
          or die ("Connection to database failed.\n");
      my $sql="select * from table";
      my $sth=$dbh->prepare($sql);
      $sth->execute;
      my $results=$sth->rows;
      my $results_per_page = 10;
      my $pagesrequired = ceil($results / $results_per_page);
      my $sth1=$dbh->prepare("select * from table limit $limit,$results_per_page");
      $sth->execute
      
      
      display first 10 records on 1 web page
      
      this is where i get stuck
      
      
      }
      Last edited by numberwhun; Mar 16 '10, 06:09 PM. Reason: Please use code tags!

      Comment

      • RonB
        Recognized Expert Contributor
        • Jun 2009
        • 589

        #4
        Data::Page - help when paging through sets of results


        Data::Paginate - Perl extension for complete and efficient data pagination

        Comment

        • dabella
          New Member
          • Mar 2010
          • 3

          #5
          Thanks all, i figured it out

          Comment

          Working...