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

Displaying Category Name

Thread began 1/01/2015 5:14 pm by Kumel | Last modified 1/05/2015 12:53 pm by Jason Byrnes | 353 views | 5 replies |

Kumel

Displaying Category Name

I got a Products table where all general information is stored.

& productcategories table has all categories.

In Products table, each product store CatID. Now if i m on a product page & want to display CatName from productcategories table linking wit CatID how it do it?

Products table ProductCatID


DB screenshots attached.

Sign in to reply to this post

Jason ByrnesWebAssist

use a join query to join the products.ProductCatID column on the product categories.CategoryID column.

see this page at w3schools for more details on sql joins:
http://www.w3schools.com/sql/sql_join.asp

Sign in to reply to this post

Kumel

well i had worked on the same.

I m adding this on my product-detail.php page now.

Already there is an existing product RS so not sure how well to edit them & view the category name.

I created a new RS which had got these:
SELECT Products.ProductID, productcategories.CategoryName, Products.ProductCatID
FROM Products
INNER JOIN productcategories
ON Products.ProductCatID=productcategories.CategoryID

Result seems fine, all results are shown but how do we include param variable into it to show particular product result (category name)?

All files attached also screenshot of NewRS & Existing RS for displaying product details.

I m not very sure if we need to modify existing RS or create RS for displaying category name.

Regards

Sign in to reply to this post

Kumel

I made a new RS ie:

SELECT Products.ProductID, productcategories.CategoryName, Products.ProductCatID
FROM Products INNER JOIN productcategories ON Products.ProductCatID=productcategories.CategoryID
WHERE Products.ProductID=colname1

colname1 type 'int' default value as '-1' and run-time value as : '$_GET['ProductID']

But no results found.

Sign in to reply to this post

Kumel

well i found my answer here:

http://www.webassist.com/forums/posts.php?id=8240

Thanks anyways :)

But got a solve doubt & stuck on it.

I used to it to display product category name on product detail page. Now when i use the same on other page ie. all products page where all products are viewed there it doesn't show cat name. Only last cat name is shown from database.

Tables are:
Products(all products are here) & productcategories (category names are here)

Have attached two files. product-detail is particular product page & other page is all products page where i have used repeat region to show all products which within has categoryname in it. But as said doesnt show right category name
Help needed.
Regards



Regards

Sign in to reply to this post

Jason ByrnesWebAssist

your catname recordset needs to be a vested recordset, nested in the product repeat region.

see this tutorial:
http://www.webassist.com/tutorials/Display-nested-recordsets

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