473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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.
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

4 2302
numberwhun
3,509 Expert Mod 2GB
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
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
RonB
589 Expert Mod 512MB
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
Thanks all, i figured it out
Mar 24 '10 #5

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

Similar topics

3
by: somaBoy MX | last post by:
I'm building a site where I need to pull very large blocks from a database. I would like to make navigation a little more user friendly by splitting text in pages which can then be navigated. I...
6
by: Earl Anderson | last post by:
I have a A97/XP applet I've developed for my own use in my department. My boss "suggests" that since I built it, I share it with and instruct the other 6 members of my department on its use. I've...
9
by: Noesis Strategy | last post by:
My firm is creating a database that profiles (about 100) companies in various sectors. Each profile is about 10 pages long with perhaps 150 parameters. Some of the parameters will contain a half...
2
by: Gary Lynch | last post by:
I am looking for a simple solution to a recurrent problem with imported data in Access 97. The example below is a simplification of a problem with a much larger database. Let's say I start out...
1
by: Coy Howe | last post by:
This one seems bizarre! We have a database consisting of a main table and 12 - 15 "sub" tables, which are connected via cascading relationships. The database performs many complex calculations...
4
by: karunakar rao | last post by:
Hi All I need some help. I have been populated 50,000 Records in asp.net C# datagrid. Ever page has 10 records Example "<< Prev 1 2 3 4 5 6 7 8 9 10 Next>> Iam showing like that in my...
2
by: Patrick | last post by:
Hello, I need some advice on how to handle the following scenario in Javascript. Imagine an HTML page that displays relational database records from an address book application. Each record...
5
by: mctime | last post by:
Hello, I am attempting to split a raw data table into a new table that has split out a specific field in the raw data and created a new record for each split but I have come to an impasse due to...
7
by: underground | last post by:
I have a problem that I've spent countless hours on and I'm more than certain this is a obviuos issue to an expert but I am still learning. I have a paging script that I have modified to display a...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.