Desperately need help with Join

3 posts by 2 authors in: Forums > CMS Builder
Last Post: August 8, 2017   (RSS)

By Dave - August 8, 2017

Hi dlsweb, 

This isn't an officially supported option, but it's not going away so you can try it out.  Try this: 

// load records from 'accounts'
list($accountsRecords, $accountsMetaData) = getRecords(array(
  'tableName' => 'accounts',
  'perPage' => '25', 
  'loadUploads' => false,
  'allowSearch' => false,
  'leftJoin' => array( // Note: leftJoins require you to use fully qualified fieldnames in WHERE and ORDER BY, such as tablename.fieldname
    'festivals' => 'ON accounts.num = festivals.createdByUserNum',
  ),
));

Let me know if that works for you.

An alternative approach is just to load the festivals and or account separately as in this post: 
https://www.interactivetools.com/forum/forum-posts.php?postNum=2240982#post2240982

Dave Edis - Senior Developer
interactivetools.com

By dlsweb - August 8, 2017

Works great, Thanks so very much