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

Related Products displaying viewing product

Thread began 3/09/2016 3:50 am by Kumel | Last modified 3/09/2016 1:42 pm by Ray Borduin | 87 views | 3 replies |

Kumel

Related Products displaying viewing product

I have a product details page. Product RS:

$query_ProductDetails = sprintf("SELECT * FROM Products WHERE ID = %s", GetSQLValueString($colname_ProductDetails, "int"));



I have a section where i display related product using SubCatID from Products

$query_RelatedProducts = "SELECT * FROM Products WHERE SubCatID IN (".$row_ProductDetails['SubCatID'].")";



Lets say i want to show just 3 related products. I don't want the existing product to be shown in related products.

How do we do this?

Sign in to reply to this post

Ray BorduinWebAssist

$query_RelatedProducts = sprintf("SELECT * FROM Products WHERE SubCatID IN (".$row_ProductDetails['SubCatID'].") AND ID <> %s", GetSQLValueString($colname_ProductDetails, "int"));

Then when you do a repeat region to display a record from this recordset you can set it to display just 3 results.

Sign in to reply to this post

Kumel

Thanks a lot but, what is %s

Sign in to reply to this post

Ray BorduinWebAssist

%s gets replaced with the value passed in after it... you can see it in your code in the first recordset you referenced.

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