Help - Search - Members - Calendar
Full Version: What is best way to show Search result pages
HTMLHelp Forums > Programming > Server-side Scripting
venkat_walking

Hi,

I am developing a social-networking based website.

I am now in ot creating search page. I dont know how to show result pages. I have following queries. I am using MYSQL as database

1) I see many of the website show there search result pages in GET method. Why?

2) Suppose any search fetches 100 results and in page I can only show maximum upto 10 results. So what best algo should I use to show 10 pages?
I know Mysql provides limit clause.
-- Should I maintain the results in session through array variable

There are so many questions. I done know how ro ask

Please help me with paging technique, if there are any.


Thanks

Venkat
Darin McGrew
QUOTE(venkat_walking @ Nov 8 2009, 03:43 AM) *
1) I see many of the website show there search result pages in GET method. Why?
Why would they use POST? See also Methods GET and POST in HTML forms - what's the difference?
pandy
What does "idempotent" mean?

[ADDED]
In this context, I mean. I can look the word up, but it doesn't always give any special computerese meaning,
Brian Chandler
QUOTE(pandy @ Nov 9 2009, 08:03 AM) *

What does "idempotent" mean?

[ADDED]
In this context, I mean. I can look the word up, but it doesn't always give any special computerese meaning,


It's a mathematical word. From the Penguin Dict. of Maths.:

"Describing a quantity that is unchanged by multiplication by itself"

So in the integers, 1 is idempotent because for any n, n * 1 * 1 = n * 1 (=n). So is 0, because m * 0 * 0 = m * 0 (=0).

I think it's an unnecessarily fancy term: it just means "doesn't matter if you call it twice" (which is close, but not quite the same as "having no side effects").

HTH
pandy
Not really. How does that relate to forms? "Call it twice"? unsure.gif
Christian J
QUOTE(pandy @ Nov 9 2009, 06:08 AM) *

Not really. How does that relate to forms? "Call it twice"? unsure.gif

Or "more than once". http://www.w3.org/TR/html401/interact/form...l#submit-format says

The "get" method should be used when the form is idempotent (i.e., causes no side-effects). Many database searches have no visible side-effects and make ideal applications for the "get" method.

If the service associated with the processing of a form causes side effects (for example, if the form modifies a database or subscription to a service), the "post" method should be used.


The word "idempotent" was obviously chosen in order to make the spec clearer and avoid potential confusion. rolleyes.gif
pandy
Korpela actually explains it a bit down the page.

"But here, in fact, idempotent processing means that a form submission causes no changes anywhere except on the user's screen (or, more generally speaking, in the user agent's state). Thus, it is basically for retrieving data."

I get THAT. cool.gif
Brian Chandler
QUOTE(pandy @ Nov 9 2009, 09:21 PM) *

Korpela actually explains it a bit down the page.

"But here, in fact, idempotent processing means that a form submission causes no changes anywhere except on the user's screen (or, more generally speaking, in the user agent's state). Thus, it is basically for retrieving data."

I get THAT. cool.gif


He might explain it like that, but if you are going to use a fancy word like "idempotent" it's worth getting it right. Idempotent is close to, but does _not_ mean "not having side effects", it means -- well I quoted a definition before -- but what matters is that fetching the same GET URL twice has the same effect as fetching it once. It might have all sorts of side effects, causing new entries to be made in a database for example, but two calls to the same GET will have the same overall side effects as a single call.

In fact this (being idempotent) is what matters, so www3 seem to have got the right word by accident, and followed up by demonstrating their own confusion. Perhaps the person who started using the term had left?
venkat_walking
can u please go somewhere and dicuss what idempotent is?

I posted question here.


thanks venkat
Frederiek
Google for "php mysql pagination".
pandy
Sorry, but it was related to your question nr 1. blush.gif
venkat_walking
Sorry I was quick to react.

I will go through all the discussions caresfully.

Thanks Venkat.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.