scrubbicus Posted April 13, 2009 Share Posted April 13, 2009 I'm trying to create my own search engine for my website with what others post and I'm having problems creating multiple pages when the user limits the search to specific number of results. What I'm thinking of trying to do and I can't think of any other way for me to be able to do this is create a cookie with all the IDs that have been displayed and all the IDs in total and that cookie will be unset when they've searched a new query. For instance they searched for automobile and there's a total of 20 results, they limit the search to 5 per page so as it loops through the MySQL database to get all 20 results it'll put those 20 results' IDs into a cookie as a string and then it'll put the 5 results that showed on the page into another cookie as a string. When the user clicks the next page it'll check to see if there's a cookie named usedID and if so it'll search through that cookie string using strstr() while looping through MySQL and if a MySQL id turns up that strstr() finds in usedID it won't display and it'll do that for all the pages of results until all the IDs are in usedID then it won't display a Next Page -->. Is this the correct way? I'm not going to be using Sessions. How are most dynamic search engines like this programmed? Any help would be appreciated. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/153806-creating-a-search-engine-problem-with-making-multiple-pages/ Share on other sites More sharing options...
Philip Posted April 13, 2009 Share Posted April 13, 2009 Pagination? http://www.phpfreaks.com/tutorial/basic-pagination Quote Link to comment https://forums.phpfreaks.com/topic/153806-creating-a-search-engine-problem-with-making-multiple-pages/#findComment-808352 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.