webguy262 Posted September 23, 2007 Share Posted September 23, 2007 I am modifying some pages in CRE Loaded. allprods.php list all currently active products and I added a manufacturers column that displays who makes that product. I want to allow shoppers to filter the product list so that it shows only products from a particular manufacturer. I have gone through several scenarios in my mind, but nothing I've thought of seems simple and bullet proof. One of the issues is that the all products query includes all manufacturers. If I were to put a variable in the query to select only a particular manufacturer, how would I code it so it does not interfere with the all products query? Would logic based upon the value of a form action work? If form action exists, someone wants to filter. If not form action or form action = all, then they want the whole list. Seems like filtering a list is pretty common and there should be an easy solution. Suggestions? TIA Quote Link to comment https://forums.phpfreaks.com/topic/70348-filter-results-of-query/ Share on other sites More sharing options...
trq Posted September 23, 2007 Share Posted September 23, 2007 Would logic based upon the value of a form action work? If form action exists, someone wants to filter. If not form action or form action = all, then they want the whole list. Yeah, something like that. You would then have two seperate queries. One sorted selecting only a certain manufacturer, the other as per normal. Can't really help much more without seeing some code. Quote Link to comment https://forums.phpfreaks.com/topic/70348-filter-results-of-query/#findComment-353377 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.