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

select statement

Thread began 6/14/2016 3:01 am by Jamie | Last modified 6/15/2016 1:12 pm by Ray Borduin | 101 views | 7 replies |

Jamie

select statement

Hey Ray

Am trying to get a RS setup that shows results firstly if productcategories Live = 1 and then show each item so long as productmanufacturers Live = 1

I have got this where the productcategories element is working but not the manufacturers side of things

<?php
$Categories = new WA_MySQLi_RS("Categories",$DBConnection,0);
$Categories->setQuery("SELECT productcategories.*, products.*, productmanufacturers.* FROM products LEFT OUTER JOIN productcategories ON products.ProductCategoryID = productcategories.CategoryID LEFT OUTER JOIN productmanufacturers ON products.ProductCategoryID = productmanufacturers.ManufacturerID WHERE productcategories.Live = 1 AND productmanufacturers.Live = 1 AND productcategories.CatPermalink = ? AND products.ProductLive = 1 ORDER BY products.ProductOrder ASC");
$Categories->bindParam("s", "".$_GET["perm"] ."", "-1"); //permparam
$Categories->execute();
?>



Not sure how to get the manufacturers side of things set correctly.

Many thanks

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

I'm not sure I understand.... you want to show all items where the category is live first, then show all items where the manufacturer is live even if the category is not live after?

Sign in to reply to this post

Jamie

sorry, no. if the productcategories element is set to Live it returns all products within that category. However, if a products manufacturer id is not live then that product should not show, but the others will...

Sign in to reply to this post

Ray BorduinWebAssist

It seems like your query would work. What rows aren't showing but should? or are showing but shouldn't? Do all products have a manufacturer specified or is that the issue?

Sign in to reply to this post

Jamie

See PM

Sign in to reply to this post

Jamie

actually, its not returning any items even if they are set to live for product, category or manufacturer

Sign in to reply to this post

Ray BorduinWebAssist

You have:
LEFT OUTER JOIN productmanufacturers ON products.ProductCategoryID = productmanufacturers.ManufacturerID

shouldn't that be:
LEFT OUTER JOIN productmanufacturers ON products.ProductManufacturerID = productmanufacturers.ManufacturerID

Sign in to reply to this post

Jamie

only one word.....doh!

thanks mate

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