Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 6th, 2000, 10:56 AM
rosie rosie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 6 rosie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Looking for some information on how I might code next and previous links. Have a number of titles pulled from a database and would like to give users the ability to go through each title one by one. At the moment, I have next 10 and previous 10 working. How would I go from one to the next one.
Anybody???

------------------
Rosie

Reply With Quote
  #2  
Old July 6th, 2000, 11:57 PM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan
Rosie,

i have given an example for same topic at:
http://www.devshed.com/Talk/Forums/...TML/000234.html


see that and edit as per your requirment..




------------------
SR -
webshiju.com

"The fear of the LORD is the beginning of knowledge..."

Reply With Quote
  #3  
Old July 7th, 2000, 02:35 AM
rosie rosie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 6 rosie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks Shiju. I had already found that script before I posted my query but hadn't had a chance to try it out. I'll do that this morning and let you know how I get on.



------------------
Rosie

Reply With Quote
  #4  
Old July 7th, 2000, 11:09 AM
rosie rosie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 6 rosie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Shiju Rajan:
Rosie,

i have given an example for same topic at:
http://www.devshed.com/Talk/Forums/...TML/000234.html


see that and edit as per your requirment..



[/quote]


Reply With Quote
  #5  
Old July 7th, 2000, 11:12 AM
rosie rosie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 6 rosie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Shiju,
I can see how that code works but can't quite figure out how to adapt to my needs. Not been programming very long!!
I have approx 2000 records in a database which a user can select to view in blocks of 5 or 10 then view next 5 or 10 and so on. I need a link at the top of the record allowing them to move on to the next one record and not the next 5 or 10. I can see how you are deciding how many pages require a link but I seem to be bringing up a few hundred with a link to the next few hundred at the bottom.
What am I doing wrong or not seeing??? Think its too late on a Friday afternoon to think too deeply!!

------------------
Rosie

Reply With Quote
  #6  
Old July 8th, 2000, 01:01 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan

Rose ,

i'll help you to sort it out your problem..


<<
I need a link at the top of the record allowing them to move on to the next one record and not the next 5 or 10.

this i'm not clear.....


but I seem to be bringing up a few hundred with a link to the next few hundred at the bottom.


ok..but it may take sometimes to populate on the screen...

Can you tell me the details ,how you want to display the records? or you may post your code ,i'll edit it and give back to you..

Tell me which database you are using for saving records?..

If you are using mysql ,then your job is very easy especially becoz you can use LIMIT clause in the select statement....






------------------
SR -
webshiju.com

"The fear of the LORD is the beginning of knowledge..."

Reply With Quote
  #7  
Old July 8th, 2000, 02:21 AM
chinnavi
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
i m also closely watching whts going on here.
b'cos im doing this project now ..
I modified something in The Program given by Shiju and it is working well and fine.

vijay

Reply With Quote
  #8  
Old July 8th, 2000, 04:14 AM
rosie rosie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 6 rosie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi Shiju.
Here is exactly what should happen. On the first search form, a user enters a date and a few other relevant details. Clicks the search button. The mysql database is searched and brings out a list or records according to the date the user entered. These records at that point are displayed in a table by the title of the record only as a hyperlink. The user clicks on the title he wants to view and the whole record is displayed on the next page. At the top of that page are links for next and previous searches. The next search takes the user back to the original search form to allow him to carry out the search again. The previous search takes him back to the form with the previous search terms already entered allowing him to amend one or more of them. And the other link is for next and previous blocks. ie, if he clicks Next he can view the next 5 block of records. If he clicks previous, he can view the previous 5. However, I also want to include another next link which will allow the user to move on to the next record and then the next, one at a time. So if he is currently viewing record number 1250, he can click next and move on to 1251 or back to 1249. Does this all make sense?
You've been a great help so far and I really appreciate. I sit here on a Saturday morning when I would much rather be home relaxing!!
Thanks again.

------------------
Rosie

Reply With Quote
  #9  
Old July 8th, 2000, 05:15 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan
yea Rose!!,

I understand what you are explaining above.It can be done..Explainig the logic will take few minutes.Now i am involved in some urgent Java projects.

Tommorow(Sunday) after charch i'll get some free time,then i'll explain you the complete logic how you can implement this very easily..


<<
I sit here on a Saturday morning when I would much rather be home relaxing!!
>>

Saturday must be a holiday for you.But you know,we'll have to work 6 days here in India.Sunday will go with full time church activities...so no free time at all..


------------------
SR -
webshiju.com

"The fear of the LORD is the beginning of knowledge..."

[This message has been edited by Shiju Rajan (edited July 08, 2000).]

Reply With Quote
  #10  
Old July 9th, 2000, 03:47 AM
chinnavi
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:

Your Requirement is simple and easily can done .
this is the program logic you have to do ...

1.Have you designed the HTML form?
2.Write the CGI to take all the parameters..
3.This will the program flow..

#!usr/bin/perl
use CGI;
use DBI;

$q = new CGI ;
$dsn = "dbi:mysql:database";
$user = "name";
$pwd = "password";

# Get all the values from the form ..
$day = $query->param('day');

#connect to the DB

my $dbh = DBI->connect($dsn,$usr,$pwd) | | die "Connecting Error!";
my $sql = qq { select * from database where constraints };
my $sth1 = $dbh->prepare( $sql );
my $numrows = $sth1->execute;

# Now $sth1 will contain the results ..
# Process the Results
while ($sth1->fetchrow_array)
{
#print the results here
}

------

this is the simple program that will do the interface ...
Do practice this then practice the program in
previous one ...given by shiju.

all the best

vijay



Reply With Quote
  #11  
Old July 11th, 2000, 02:43 AM
rosie rosie is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 6 rosie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks Vijay. However, that part of the program is already working!



------------------
Rosie

Reply With Quote
  #12  
Old July 11th, 2000, 02:53 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan
Rosie,


<<However, that part of the program is already working!>>

Then where you are stucking up?

---


------------------
SR -
webshiju.com

"The fear of the LORD is the beginning of knowledge..."

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Next/Previous Links in Perl

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap