Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Displaying pages of search

Posted on 2000-05-04
20
Medium Priority
?
137 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
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…
Six Sigma Control Plans

916 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