Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

Search & Pagination

posted by raff 8 years ago

I want to create a search script but I need to paginate the results any ideas?

I have been using sessions the problem its people who uses the multi tab browsers :S

posted by mungiu 8 years ago

I think the problem its that you miss the search string right? If so, you can hash it and save it into one table.

posted by anonymous 8 years ago

Why are you storing search results in the session? Do your searches take that long to execute?

posted by wbond 8 years ago

I have more than 1000000 records to show. I already paginate this and it works fine. My problem begins when the user use the filters to reduce the numeber or records. I can paginate the first page but after this I lost the original search string beacuse I cant include the search terms into the url so I saved it into the the session but if the user uses a multitab browser it fails.

As an example

www.example.com/products/search/

This page shows the last 25 records from the table.

1 2 3 ... .. 25

First < 1 2 3 4 5 ... > Last

www.example.com/products/search/1 www.example.com/products/search/26 www.example.com/products/search/51

etc

In this page I show 2 inputs Product name, Price, and one select Category the user can use them to filter the results

1 2 3 ... .. 25

First < 1 2 3 > Last

When the user click in one of this links I lost the query terms because I cant include them into the url

www.example.com/products/search/'''silver'''/.../51 /

I'm saving it into the session but if the user open a secound tab in his browser the terms are overwritten.

posted by raff 8 years ago

Any ideas?

posted by raff 8 years ago

Why can't the search terms be in the query string?

posted by wbond 8 years ago

category/price/record SEO U_U and they doesn't like how it looks example.com/products/search/medicine/10/25

I created a table where I insert the serialize() of the serach terms using a sha1 hash as a Key

example.com/products/search/azkf59785SD455.../25

They like it but since the user can save the url in a bookmark but I dont feel good with this behaviour any Good practice for Paginate search results?

posted by anonymous 8 years ago