close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Filtering Product Results question

Thread began 10/22/2015 9:55 am by Charles | Last modified 10/26/2015 2:50 pm by Ray Borduin | 537 views | 6 replies |

Charles

Filtering Product Results question

With your help, I have a good working products_results.php page. I now have 2 sites with different skins using the same DB,. I need to filter the Categories displayed when you rollover the "Products' button on the top Nav to display only the Categories designated for each particular site. So I need to add a statement like 'FROM category WHERE Stone_Center = 1' to filter the displayed categories on the dropdown. I've tried but can't seem to get it. Your help would be appreciated. You can see the dev site at http://outofchaos.net/sstone/www/index.php Rollover 'Products' and only a few categories should display if we get this right. Products_results.php is attached.

Sign in to reply to this post

Ray BorduinWebAssist

I don't really understand. The link you gave doesn't work, so I can see it.

When do you want the categories filtered? on the results page or in the menu? How do you know to filter it or not? I don't know what dropdown you are referring to filtering. The page you provided doesn't seem to have a dropdown on it.

Sign in to reply to this post

Charles

Sorry for the incorrect link - see PM.

Sign in to reply to this post

Ray BorduinWebAssist

You can add: "WHERE Stone_Center = 1'" to lin e98 of the results page before the "GROUP BY".

It looks like you have already updated the menu.php page to have: "WHERE Schofield_Stone=1" is that working?

Sign in to reply to this post

Charles

The Where clause in menu.php is working now and now filters the dropdown of categories correctly.

When I insert the "WHERE Stone_Center = 1'" to lin e98 of the results page before the "GROUP BY in the products_results.php, I get this error message: "Column 'Stone_Center' in where clause is ambiguous" Maybe a syntax issue?

Sign in to reply to this post

Ray BorduinWebAssist

You must have a column named Stone_Center in both the products and categories table. It just wants to know which one you are referring to. Try using:

WHERE category.Stone_Center = 1'

Sign in to reply to this post

Charles

Thank you! I did have Stone_Center in both the categories and products table and since the menu.php is filtering the Categories, I wanted the products_results.php to filter the Products displayed. So I used Where products.Stone_Center=1 and that did the trick.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...