• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 143
  • Last Modified:

Displaying pages of search


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
leoleo
Asked:
leoleo
  • 13
  • 3
  • 2
  • +1
1 Solution
 
leoleoAuthor Commented:
Adjusted points from 30 to 50
0
 
leoleoAuthor Commented:
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
 
maneshrCommented:
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
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
leoleoAuthor Commented:
What do you suggest I do?
0
 
maneshrCommented:
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
 
CJ_SCommented:
I would say that if you use ASP I've got the solution for you.
0
 
leoleoAuthor Commented:
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
 
CJ_SCommented:
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
 
leoleoAuthor Commented:
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
 
Michel PlungjanIT ExpertCommented:
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
 
leoleoAuthor Commented:
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
 
Michel PlungjanIT ExpertCommented:
There will be only the overhead of 40 more results.
However the user saves 4 server connections

Michel
0
 
leoleoAuthor Commented:
> the user saves 4 server connections

That's a valid point.
0
 
leoleoAuthor Commented:
Sorry folks, I will be away for another week. I'll get back to you after that.
0
 
leoleoAuthor Commented:
Thanks Michel & CJ. Shall I accept one comment as answer & post another question for the other person?

0
 
Michel PlungjanIT ExpertCommented:
You can also get Customer Services to split the points, if you wish. Thanks for asking...

Michel
0
 
leoleoAuthor Commented:
No, I don't want to split points. This question's worth only 50 points. I'll post another question.

:o)
0
 
leoleoAuthor Commented:
Comment accepted as answer
0
 
leoleoAuthor Commented:
Thanks again. I am posting another question for CJ with the same amount of points.
0
 
leoleoAuthor Commented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 13
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now