coolphpdude Posted March 12, 2008 Share Posted March 12, 2008 Hi, quick question for you... is it possible to search within a search result (refine an existing search). If i done an original search ($keyword as the searched word) e.g. $search = mysql_query("SELECT * FROM holidays WHERE holiday_hotel = $keyword") is it then possible on the next page to have another search box where the user could type in another keyword to search for? so for example, the user has searched for 'leazes hotel' and returned 30 results from various different countries around the world, could the user then search for 'france' as the location within that existing search result?? Thanks Link to comment https://forums.phpfreaks.com/topic/95779-searching-within-a-search-result/ Share on other sites More sharing options...
unsider Posted March 12, 2008 Share Posted March 12, 2008 Yes. I'm pretty sure it's possible. Where you place your code is the trick. Link to comment https://forums.phpfreaks.com/topic/95779-searching-within-a-search-result/#findComment-490336 Share on other sites More sharing options...
coolphpdude Posted March 12, 2008 Author Share Posted March 12, 2008 what i actually want the user to do is go see the original results and then refine the results Link to comment https://forums.phpfreaks.com/topic/95779-searching-within-a-search-result/#findComment-490337 Share on other sites More sharing options...
coolphpdude Posted March 12, 2008 Author Share Posted March 12, 2008 Any idea how then? Link to comment https://forums.phpfreaks.com/topic/95779-searching-within-a-search-result/#findComment-490351 Share on other sites More sharing options...
coolphpdude Posted March 12, 2008 Author Share Posted March 12, 2008 can it be done or could someone point me in the right direction of something that could help me? Link to comment https://forums.phpfreaks.com/topic/95779-searching-within-a-search-result/#findComment-490428 Share on other sites More sharing options...
soycharliente Posted March 12, 2008 Share Posted March 12, 2008 Create a form that has hidden inputs for what they search the first time. All the user would see if a button that says refine search and all the previous values from the form would be submitted to a page. That page would just populate the search form again with what is posted. Link to comment https://forums.phpfreaks.com/topic/95779-searching-within-a-search-result/#findComment-490444 Share on other sites More sharing options...
coolphpdude Posted March 12, 2008 Author Share Posted March 12, 2008 ahh so carry forward the original search keyword and then take in the refined search as '$refine' then resubmit the search as select * from holidays where holiday_hotel = $keyword AND holiday_location = $refine?? Link to comment https://forums.phpfreaks.com/topic/95779-searching-within-a-search-result/#findComment-490453 Share on other sites More sharing options...
soycharliente Posted March 12, 2008 Share Posted March 12, 2008 If you want both variables to come into play, sounds like a plan to me. Link to comment https://forums.phpfreaks.com/topic/95779-searching-within-a-search-result/#findComment-490466 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.