Get file uploads from a joined table

5 posts by 3 authors in: Forums > CMS Builder
Last Post: November 1, 2012   (RSS)

By sykomac - February 6, 2010

I have two databases: programs and program_addresses

program_addresses has an upload field allowing upload of 1 image

I create a Select on programs database with a leftJoin on program_addresses

list($programsRecords, $programsMetaData) = getRecords(array(
'tableName' => 'programs',
'allowSearch' => '0',
'loadUploads' => 'yes',
'where' => 'start_time <= "2110" AND end_time >= "2110" AND day LIKE "%Sat%"',
'leftJoin' => array(
'program_addresses' => 'program',
),

));


The search finds the correct matching records but I am not able to get access to the upload field from the program_addresses database.

Am I missing something?

Re: [sykomac] Get file uploads from a joined table

By Dave - February 8, 2010

Hi sykomac,

The 'leftJoin' option doesn't yet support loading uploads for the joined table.

So, it could be a bit tricky. You could try doing a separate getRecords() call for 'program_addresses' with a where that loaded the records you wanted based on some criteria from the previous table you loaded.

How many programs are you displaying on a page?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Get file uploads from a joined table

By sykomac - February 8, 2010

Dave,

Thanks for the info.

I only need to display one program with the upload at a time on the page so I guess I'll just have to do a second search.

Thanks

Re: [Dave] Get file uploads from a joined table

Any idea when this functionality will be available?