By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,933 Members | 1,675 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,933 IT Pros & Developers. It's quick & easy.

Splitting Records into HTML Pages from a database

P: 3
Hello all, i'm would like to know if there is a method to split up records from a database into multiple HTML pages.
Mar 15 '10 #1

✓ answered by RonB

Data::Page - help when paging through sets of results
http://search.cpan.org/~lbrocard/Dat...b/Data/Page.pm

Data::Paginate - Perl extension for complete and efficient data pagination
http://search.cpan.org/~dmuey/Data-P....6/Paginate.pm

Share this Question
Share on Google+
4 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
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
Mar 16 '10 #2

P: 3
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl -w
  2. $|++;
  3. use strict;
  4. use DBI;
  5. use CGI;
  6. use POSIX;
  7. my $limit;
  8. if (!$limit) {
  9.    $limit=0;
  10. my $dbh = DBI->connect($dbname, $dbusername, $dbpassword)
  11.     or die ("Connection to database failed.\n");
  12. my $sql="select * from table";
  13. my $sth=$dbh->prepare($sql);
  14. $sth->execute;
  15. my $results=$sth->rows;
  16. my $results_per_page = 10;
  17. my $pagesrequired = ceil($results / $results_per_page);
  18. my $sth1=$dbh->prepare("select * from table limit $limit,$results_per_page");
  19. $sth->execute
  20.  
  21.  
  22. display first 10 records on 1 web page
  23.  
  24. this is where i get stuck
  25.  
  26.  
  27. }
  28.  
Mar 16 '10 #3

Expert Mod 100+
P: 589
Data::Page - help when paging through sets of results
http://search.cpan.org/~lbrocard/Dat...b/Data/Page.pm

Data::Paginate - Perl extension for complete and efficient data pagination
http://search.cpan.org/~dmuey/Data-P....6/Paginate.pm
Mar 16 '10 #4

P: 3
Thanks all, i figured it out
Mar 24 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.