Show products related to the compnay - intval

3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 30, 2012   (RSS)

Re: [benedict] Show products related to the compnay - intval

By Jason - July 30, 2012

Hi,

This is actually a pretty common problem. The issue here is when you used a multiselect list field. In CMS Builder, these fields are stored as a string separated by tab (\t) characters. You can fix this problem but chaning your where caluse slightly like this:

// load records from 'products_services'
list($products_servicesnavRecords, $products_servicesnavMetaData) = getRecords(array(
'tableName' => 'products_services',
'where' => "associated_company LIKE '%\t". intval($companiesRecord['num']) ."\t%'" ,
'debugSql' => true, // optional, display SQL query, defaults to no
));


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Show products related to the compnay - intval

By benedict - July 30, 2012

Great. Thanks - worked a treat.