Selecting Records from Tabbed data

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

Re: [aquaman] Selecting Records from Tabbed data

By Jason - June 30, 2010

Hi,

"IN" is used to search a list, but CMS Builder stores the multi selects as a string. We can get around this by using "LIKE".

Try this code:

$destNum = $destinationsRecord['num'];

if (!$destNum) { $destNum = 1; } // default num

$destNum = "%\t".$destNum."\t%";

list($yachtsRecords, $yachtsMetaData) = getRecords(array(
'tableName' => 'yachts',
'allowSearch' => '0',
'where' => "destinations LIKE '$destNum'" . ' AND active ="1"' . ' AND hide ="0"',
'useSeoUrls' => true,
'debugSql' =>'true',
));


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] Selecting Records from Tabbed data

Awesome thanks, that worked a treat!