Thanks for this, so I am still having an issues, the mysql debug is showing up the correct values:
SELECT SQL_CALC_FOUND_ROWS `yachts`.*
FROM `cms_yachts` as `yachts`
WHERE (type IN ('motor','sailing','catamaran','power-catamaran','gulet','motorsail','mega-yacht') AND active ='1' AND hide ='0' AND private ='1' )
but Im still not getting back any results. Is it because the type field in the yacht table is holding multiple text values separated by tabs? e.g.
" gulet "
" sailing gulet motorsail "
" gulet motorsail "
Here's my code:
if ($CURRENT_USER['preferred_yacht_types']) {
$preferred_yacht_types = explode("\t", trim($CURRENT_USER['preferred_yacht_types']));
$user_yacht_type = mysql_escapeCSV($preferred_yacht_types);
} else {
$user_yacht_type = "";
}
list($yachtsRecords, $yachtsMetaData) = getRecords(array(
'tableName' => 'yachts',
'where' => "type IN (" . $user_yacht_type . ") AND active ='1' AND hide ='0' AND private ='1' ",
'loadUploads' => true,
'allowSearch' => true,
'useSeoUrls' => true,
'limit' => 3,
'debugSql' => true,
));