turpentyne Posted September 7, 2010 Share Posted September 7, 2010 I'm ready for the next step on my site, which is learning how to filter results down with a second search. The scenario is: A viewer searches for a plant by 4 variables to describe the leaf. After submit, they go to the results page, with 200 paginated results. (This is where I've gotten to) Now, on that same page, they choose to further narrow their results by searching those 200 results for plants that have purple flowers. Maybe they get 40 results and can use another variable to narrow further - and so on. What's the best way to set this up? I've been looking into temporary tables, but it seems to be a challenge because the table deletes the moment they leave that page or close the connection? Sessions seem like another possibility, but I read there's security issues. What's the best way to set this up? Just re-query the database with the entire set of variables from both the first and second searches? is it quicker to build some type of permanent table with a timestamp that I can use to delete it after the user has gone away? Quote Link to comment Share on other sites More sharing options...
Rifts Posted September 7, 2010 Share Posted September 7, 2010 This is kind of difficult because I don't know how you search or databases are set up, but if they are set up how I have imagined its something like click search and it does a SELECT * FROM table WHERE leaf = round then maybe the second search to narrow it down further would be like SELECT * FROM table WHERE leaf = round, color = purple narrow down further etc Quote Link to comment Share on other sites More sharing options...
turpentyne Posted September 7, 2010 Author Share Posted September 7, 2010 Ok, let me throw a little more into the mix and see if that still works. It's a database of 300,000 entries x 4 tables. The 4 tables are for different categories. A table for description, one for uses, etc. Is it still fast to just rerun the same query with added search words, like you suggest, or is there a quicker way? This is where I'm wondering if temp tables work or some other method so the query isn't searching the entire database again. Or maybe it takes just as long or longer to build the temp table and search that? Quote Link to comment 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.