Show multiple Venues that are recommended for a type of Catering Event. Filter, Where, If Match

2 posts by 1 authors in: Forums > CMS Builder
Last Post: May 1   (RSS)

By Zicky - May 1

I got this figured out with help from a post by Greg.

Here's what I ended up with:

 //Convert the 'you might also like' num values into an array.
  $youMightLikeNums = explode("\t", trim($events_cateringRecord['recommended_venues'],"\t"));

  //If the product has linked you might also like products..
  if ($youMightLikeNums) {
    //Escape the values into a comma seperated string.
    $youMightLikeNums = mysql_escapeCSV($youMightLikeNums);
    //Pull the records with linked nums.
    list($venueRecommendedRecords, $venueRecommendedMetaData) = getRecords(array(
      'tableName'   => 'venues',
      'loadUploads' => true,
      'where'       => "`num` IN($youMightLikeNums)",
      'allowSearch' => false,
      //'debugSql'    => true,      // optional, display SQL query, defaults to no

Thanks Greg!!!