Linked tables

2 posts by 2 authors in: Forums > CMS Builder
Last Post: September 11, 2012   (RSS)

By mbareara - September 11, 2012

Hi and thanks in advance for your help

I have 3 linked tables

1) Accounts with username and password

2) Agency with name photo address etc (linked to account with CreatedbyUserNum because each account create only one agency page)

3) Products (eache agency could publish some item)

I would create a product page in wich i would recall Agency name, agency address etc but how can i join table n.2 and 3?

I try // load records
list($productsRecords, $productsMetaData) = getRecords(array(
'tableName' => 'products',
'where' => 'products.num = ' . getNumberFromEndOfUrl(),
'leftJoin' => array(
// foreign table => local field (that matches num in foreign table)
'agency' => 'createdByUserNum',
.... but it doesn't work...

:-(