close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

CategoryID

Thread began 11/07/2011 9:20 am by goat200487425014 | Last modified 11/07/2011 4:21 pm by goat200487425014 | 1359 views | 12 replies |

goat200487425014

CategoryID

I am having trouble getting my actual CategoryID to show for my products on my detail page. I get the number to show from my products table, but not the actual Name from the productcategory table. For example, if a shirt is in the Men Hoodie Category, how do I get it to show on my product detail page?

Attached Files
products_Detail.zip
Sign in to reply to this post

Jason ByrnesWebAssist

you would need to edit the product recordset to use a join query to get the category name from the category table that relates to the product.

i see you have a column in your products table named CategoryID, so an example of the query would be:
SELECT products.*, categories.CategoryName
FROM products
INNER JOIN categories
ON products.CategoryID = category.CategoryID

NOTE: Don't edit the where clause, leave the where clause as is

for more detail son join queries, see this page:
sql_join.asp

Sign in to reply to this post

goat200487425014

I have tried this but I still get the number and not the Name. Here is the SQL statement I am using.

Sign in to reply to this post

Jason ByrnesWebAssist

you have to replace the binding on the page that shows the category id with the binding for the category name.

Sign in to reply to this post

goat200487425014

Thanks that worked!

Sign in to reply to this post

goat200487425014

So when I do a product search in my product_search page, based on categories, I get the following error on my results page:

Unknown column 'CategoryName' in 'where clause'

Attached Files
products_Results.zip
Sign in to reply to this post

Jason ByrnesWebAssist

you need to edit the recordset on the results page to use the same join query from before:
SELECT products.*, categories.CategoryName
FROM products
INNER JOIN categories
ON products.CategoryID = category.CategoryID

Sign in to reply to this post

goat200487425014

Ok so now everything looks normal. The products are not displaying when I search by category though.

Attached Files
products_Results.zip
Sign in to reply to this post

Jason ByrnesWebAssist

please send a link where i can see the problem.

Sign in to reply to this post

goat200487425014

products_Search.php

Sign in to reply to this post
loading

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...