MySQL Where problem

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 29, 2015   (RSS)

By ross - April 24, 2015

Hi Paul

Thanks for posting!

I think I understand what you are aiming for.  When you setup the "Product" drop down menu to pull from another database table, you get to specify which table, then which field to store as the value (this is what gets stored in the database) and then which value you to use as the label (this is what gets displayed).

What you'll want to do first is double check what you have set as the "value". I always recommend using the "num" field from your other table so you will want to consider changing it to that if you haven't already.

Next, the code you are looking for will end up looking something like this:

'where' => "product = 1",

notice how there is no quotes around product and I just have a number after the equals.  Because I've got you using the "num" field as the label, you'll just need to make sure which record from the Products table you want to match and use its record number.  

Does that make sense? Let me know how you make out.

Thanks!

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Hi Ross,

That worked great. Thanks!

Paul