programguru Posted September 16, 2008 Share Posted September 16, 2008 Hello, I am having a very difficult time finding a decent tutorial that teaches a method of creating link based search queries. I'm not doing anything that large, but I'm just trying to get the concept of how that is done properly, so I can apply it on any scale. For example: Select a Sport: (PAGE #1) Tennis Golf Yoga You selected Yoga . Please select a Style: (PAGE #2) Select a Yoga Style: Indoor Outdoor Under Water Under Water selected Results: (PAGE #3) -- Joes Under Water Yoga -- Western Water World Yoga -- Southern Yoga of the Sea Am I making sense? Anyone know of a decent tutorial or maybe provide some insight on the best method to write these link based searches? Thanks in advance for anything Link to comment https://forums.phpfreaks.com/topic/124401-seeking-tutorial-on-linked-based-queries-w-php-and-mysql/ Share on other sites More sharing options...
DarkWater Posted September 16, 2008 Share Posted September 16, 2008 It's just basically using GET in other queries...you know how to utilize GET, correct? Link to comment https://forums.phpfreaks.com/topic/124401-seeking-tutorial-on-linked-based-queries-w-php-and-mysql/#findComment-642424 Share on other sites More sharing options...
programguru Posted September 16, 2008 Author Share Posted September 16, 2008 Hi DarkWater, Thanks for the reply. Yes I understand GET, but I was more looking for the most efficient way to do this. Also if I should use one .php page for all results, links, etc or separate pages for each link set type. I'm not looking for someone to show me how to code it all out. I just was hoping to find a tutorial on this specific method of using GET and an expandable and efficient way of doing it. Any ideas? Link to comment https://forums.phpfreaks.com/topic/124401-seeking-tutorial-on-linked-based-queries-w-php-and-mysql/#findComment-642426 Share on other sites More sharing options...
DarkWater Posted September 16, 2008 Share Posted September 16, 2008 You'd use one PHP file. How I'd really do this would be using mod_rewrite because of the fact that the URLs will get ugly really quickly and just parse out a single GET parameter. I.E: <?php //pretend that you have it set up to send http://www.yoursite.com/search/yoga/underwater to http://www.yoursite.com/search.php?search=yoga/underwater $params = explode('/', $_GET['search']); $query = "SELECT * FROM table WHERE "; foreach($params as $key=>$val) { $params[$key] = "category='$val'": } $query .= implode(" OR ", $params); //do query and stuff That's really simplified though. Link to comment https://forums.phpfreaks.com/topic/124401-seeking-tutorial-on-linked-based-queries-w-php-and-mysql/#findComment-642430 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.