Jump to content

Need to store search results + advice


raveyd

Recommended Posts

I am planning to add a search facility on a property locator site that is planned to work as follows:

 

1) Seach Words + post code entered by user.

2) The main table is queried using a FULLTEXT Search (based on posted words)

3) Each record retrieved has the distance calculated.

4) The records are now sorted into Best Match + Closest Distance order

5) Results are paginated at 20 Records per page.

 

The problem that I can't get my head around is where to store that results data so that the user can go from page to page.

 

The site is not large at the moment but potentially could have thousands of results..

 

Any advice would me most appreciated..

Link to comment
https://forums.phpfreaks.com/topic/62321-need-to-store-search-results-advice/
Share on other sites

You dont. Take a look at some pagination tutorials. You repeat the query on each page, using differant parameters for the LIMIT clause based on the page number. Of course, you'll need to pass what is being searched for from page to page to repeat the query though

I don't feel that this would work for me, because after I query the records I then run a second process by ordering them into closest Distance order (based on a post code)

Doesn't change anything... you still can use LIMIT with an offset.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.