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: [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?

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

By Dave - November 1, 2012

Hi tmudford,

We don't have any current plans for further automatic support of joins or loading of uploads.

If you're already doing a custom mysql query with a join you can always just do another query to get the uploads.

If you have records from a single table, or just want to reference some MySQL code for loading uploads, you could take a look at the functions addUploadsToRecords(), and addUploadsToRecord() in /lib/upload_functions.php

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com