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, 2020   (RSS)

By Mikey - May 1, 2020

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

https://www.interactivetools.com/forum/forum-posts.php?postNum=2243600#post2243600

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!!!

Zicky