Solved

Displaying pages of search

Posted on 2000-05-04
20
129 Views
Last Modified: 2012-05-04

When we search for something using a SearchEngine, they show the result in different pages, so that when we click on "Next" (or page 1, 2, 3 ..), it brings the remaining results. How is it done?
 
What I require is this: I am searching from a database. The select query returns, say 40 rows, and I want to show them 10 at a time, with "Next" link at the bottom. (Also links to pages 1, 2 etc.). What program shld I call at the Next link, and also the page 1, 2 etc links?

Hope my question is clear.
Thanks indeed.
0
Comment
Question by:leoleo
  • 13
  • 3
  • 2
  • +1
20 Comments
 

Author Comment

by:leoleo
ID: 2779947
Adjusted points from 30 to 50
0
 

Author Comment

by:leoleo
ID: 2779948
Is there a way using JavaScript, like all the rows have been selected, but only 10 are shown etc...?

I think if it is a JavaScript soln, it will bw faster, right?

0
 
LVL 16

Expert Comment

by:maneshr
ID: 2780743
that feature has nothing to do with any client-side program.

its the ability of the search engine to show only certain set of results at a time.

it can be simulated using PERL too, provided you have the search engine configured and running.
0
 

Author Comment

by:leoleo
ID: 2781601
What do you suggest I do?
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2781608
i would say that you first get a search engine installed, configured and running.

After that writing the PERL script is not something that will take more than a day.

0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2782168
I would say that if you use ASP I've got the solution for you.
0
 

Author Comment

by:leoleo
ID: 2783580
CJ_S: I can't use ASP, but do you think you can give me some logic which I can convert to Perl & use???

maneshr : For a little Database query returning 40-50 rows, shld I go for a search engine? I was hoping you could provide me a better or even a round-about solution which gives the same result. It is actually a small part of a big problem so I dont want to go to many difficulties for it.

0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2783590
Sure, I cannot say how Perl retrieves the RecordSet but here goes in ASP/VB

..... Connectioon stuff an all.

Set rs = Conn.Execute(Sql-statement)
start = request("start")
count = 10

for i=0 to (start * count)
   rs.movenext
next
i=start*count

while not rs.eof and i <= (start+1)*count
   ......write everything out here......
   rs.movenext
wend

<a href='samepage.htm?start=' & start+1>next</a>

this stuff _SHOULD_ get you forward every time, were I at my work I wouldve copied and paste the code and you would have it all tested etc etc....but thisis for VB / ASP......so you defeinitely should change a few things.

Good luck,
CJ
0
 

Author Comment

by:leoleo
ID: 2783653
I think I get the idea ... let me try it out. As you said, there will be changes to be incorporated. I will get back soon.

0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 50 total points
ID: 2786501
For a javacript solution, my suggestion would be to have an array with all 40 results returned in the head of a frameset page.
Onclick on next or previous, a page is dynamically written in the result frame. If you wish, navigation can be in a separate frame or written with the result

Michel
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:leoleo
ID: 2787098
Michel: If I do that, will there be extra overhead? I mean there won't be any difference, will there, whether the page loads with 10 results or 50? [I am just assuming that the no: of rows won't be much greater than 50.]

Anyway I will try out the solns you both have provided, and will let you know soon.

CJ: I was too lazy to try it out this weekend ;o)

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2787603
There will be only the overhead of 40 more results.
However the user saves 4 server connections

Michel
0
 

Author Comment

by:leoleo
ID: 2791305
> the user saves 4 server connections

That's a valid point.
0
 

Author Comment

by:leoleo
ID: 2815894
Sorry folks, I will be away for another week. I'll get back to you after that.
0
 

Author Comment

by:leoleo
ID: 2843603
Thanks Michel & CJ. Shall I accept one comment as answer & post another question for the other person?

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 2843835
You can also get Customer Services to split the points, if you wish. Thanks for asking...

Michel
0
 

Author Comment

by:leoleo
ID: 2848409
No, I don't want to split points. This question's worth only 50 points. I'll post another question.

:o)
0
 

Author Comment

by:leoleo
ID: 2848417
Comment accepted as answer
0
 

Author Comment

by:leoleo
ID: 2848418
Thanks again. I am posting another question for CJ with the same amount of points.
0
 

Author Comment

by:leoleo
ID: 2848444
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now