473,378 Members | 1,330 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,378 software developers and data experts.

previous & next buttons

hi all,

im developing a site in perl with mason on a postgreSQL backend.

i currently have a page that lists all items in a table, but would like to
do the
" << PREVIOUS 1 2 3 4 NEXT>> "

sort of thing - say LIMIT of 10 records to a page.

can someone help me out.

thanks

PP


Jul 19 '05 #1
3 2313
Doc
Yes, I would like to know how this can be done too.

--
----------------------------------------------------
This mailbox protected from junk email by Matador
from MailFrontier, Inc. http://info.mailfrontier.com

"Psybar Phreak" <ps***********@yahoo.com> wrote in message
news:3f**********************@news.optusnet.com.au ...
hi all,

im developing a site in perl with mason on a postgreSQL backend.

i currently have a page that lists all items in a table, but would like to
do the
" << PREVIOUS 1 2 3 4 NEXT>> "

sort of thing - say LIMIT of 10 records to a page.

can someone help me out.

thanks

PP

Jul 19 '05 #2
anyone?

PP
"Doc" <NO*****@verizon.net> wrote in message
news:MB****************@nwrddc02.gnilink.net...
Yes, I would like to know how this can be done too.

--
----------------------------------------------------
This mailbox protected from junk email by Matador
from MailFrontier, Inc. http://info.mailfrontier.com

"Psybar Phreak" <ps***********@yahoo.com> wrote in message
news:3f**********************@news.optusnet.com.au ...
hi all,

im developing a site in perl with mason on a postgreSQL backend.

i currently have a page that lists all items in a table, but would like to do the
" << PREVIOUS 1 2 3 4 NEXT>> "

sort of thing - say LIMIT of 10 records to a page.

can someone help me out.

thanks

PP


Jul 19 '05 #3
dw
anyone?
Yes, I would like to know how this can be done too.
i currently have a page that lists all items in a table, but would
like
to do the
" << PREVIOUS 1 2 3 4 NEXT>> "

sort of thing - say LIMIT of 10 records to a page.


how about something along the lines of:

$q = new CGI;

$start = $q->param("start") || 0;

$count = 0;
while ($db->fetch) {
$count ++;
next while $count < $start;
last if $count = $start + 10;
print "item $count : **whatever you normally do**";
}

$MAX = $total_number_of_records_in_db;

print $q->a({href=>"?...&start=" . $start-10}, "<< PREVIOUS"), " ";
print $q->a({href=>"?...&start=" . ($_ * 10 + 1)}, "$_"), " " for
1..($MAX/10);
print $q->a({href=>"?...&start=" . $start+10}, "NEXT >>");
that should give you an idea on how you can do it... and if you can tell
your db to start at record number $start, that would be even better...

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Marcel | last post by:
Hello, I'm working on a search application for my website. The website contains a lot of pictures, and a search should return clickable thumbnails. No problems there. My problem started when I...
2
by: Psybar Phreak | last post by:
hi all, im developing a site in perl with mason on a postgreSQL backend. i currently have a page that lists all items in a table, but would like to do the " << PREVIOUS 1 2 3 4 NEXT>> "...
9
by: Karl Roes | last post by:
Hi All, I would like some advice on Next / Previous record buttons. I have a main form for the client, and a continuous subform listing client transactions. If I open one of these transactions...
0
by: Dan | last post by:
HI, How can i hide the 2 buttons (next/previous month) in the MonthCalendar Control ? Is there a way to do it ? Thank is advance Dan
1
by: msnews | last post by:
Hi All, My client has following request. I am not sure how to do it. Dynamically from database, we are getting set of images names. Now we want to display them with next and previous buttons....
3
by: karen987 | last post by:
Can someone please explain what code i need to add to keep a set of links at the bottom of a pop up window? I need it in a page where people post comments. It is a pop up window, of about 500x400...
3
by: ITAutobot25 | last post by:
Now this is really the last problem (for real now) with this assignment. My sorter is not working. I managed to sort by product name in my previous assignment; however, I can't get it to work on this...
3
by: =?Utf-8?B?a2FyaW0=?= | last post by:
Hello All, if I have this code: PictureBox1.ImageLocation = "c:\file.jpg" would I be able to add a next & prevous bottons to go to the next picture in this folder or the previous one? and if I...
13
by: sweetline priya | last post by:
in my project, a table called 'hardware' contains merely 5000 records..its a mysql database.. the user can add, modify or can view this hardware details one by one.. while clicking 'view' button, the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.