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

PS3 Categories Displayed

Thread began 3/15/2010 2:14 pm by jed193733 | Last modified 3/17/2010 12:43 pm by Jason Byrnes | 790 views | 5 replies |

jed193733

PS3 Categories Displayed

Sorry if I missed this in another forum question.

On the product page I need to show all the categories a product is tagged too. I've been working with some joins but not getting the right results. Not looking to do anything else but display the categories on the page.

Could someone give me some idea of the best way to display the categories?

Thanks in advance...

Sign in to reply to this post

Jason ByrnesWebAssist

have you tried this query on the details page:

SELECT ps3_categories.CategoryName
FROM ps3_categories
INNER JOIN ps3_productcategories
ON ps3_categories.CategoryID = ps3_productcategories.ProductCategoryID
WHERE ps3_productcategories.ProductID = $_GET['ProductID']

Sign in to reply to this post

jed193733

Step 1 and 2

Hi Jason,

I took your example and made a recordset and tried it in a phpmyadmin sql call and in each case I got a #1064 error about "the syntax to use near ['ProductID'] at line 1".

Here's the SQL I came up with:

SELECT
ps3_categories.CategoryName,
ps3_categories.CategoryID,
ps3_products.ProductName,
ps3_productcategories.ProductID
FROM
ps3_categories
Inner Join ps3_productcategories ON ps3_categories.CategoryID = ps3_productcategories.CategoryID
Inner Join ps3_products ON ps3_productcategories.ProductID = ps3_products.ProductID
ORDER BY
ps3_products.ProductID ASC,
ps3_categories.CategoryName DESC

Current questions:

1. My problem is connecting this to the current row being displayed? I keep getting syntax errors trying to connect it to the $row_WADAProducts[ProductsID]
2. I'll admit I'm not good with the grouping and do/while code. I hope I have explained enough for someone to help me with this. THANKS again in advance...

Sign in to reply to this post

Jason ByrnesWebAssist

use the following for you sql:

SELECT ps3_categories.CategoryName, ps3_categories.CategoryID, ps3_products.ProductName, ps3_productcategories.ProductID
FROM
ps3_categories
INNER JOIN ps3_productcategories ON ps3_categories.CategoryID = ps3_productcategories.CategoryID
INNER JOIN ps3_products ON ps3_productcategories.ProductID = ps3_products.ProductID
WHERE ps3_products.ProductID = paramProdID
ORDER BY
ps3_products.ProductID ASC,
ps3_categories.CategoryName DESC

Then Create a new parameter in the recordset window:
Name: paramProdID
Type: Number
default Value: -1
Run Time Value: $_GET['ProductID']

Sign in to reply to this post

jed193733

Thanks...

Thanks Jason, I haven't had the time to test it yet, but understand what your showing me. Teaching Access today will get a chance to review tonight - just didn't want you to think your response wasn't valuable.... THANK YOU

Sign in to reply to this post

Jason ByrnesWebAssist

no worries.

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