Referencing joined table

2 posts by 1 authors in: Forums > CMS Builder
Last Post: September 21, 2010   (RSS)

By MisterJim - September 21, 2010 - edited: September 21, 2010

Is it possible to reference a column in a table that is joined using the joinTable statement?

Here's my code:

list($music_tracksRecords, $music_tracksMetaData) = getRecords(array(
'tableName' => 'music_tracks',
'joinTable' => 'cd_tracks',
'where' => 'cd_tracks.media =' . $mediaRecord['num'] AND 'music_tracks.num = cd_tracks.track',
));


It runs and pulls the titles that I want out of the music_tracks table, but unfortunately it pulls ALL the titles out of the music_tracks table and not just the ones that I want (where 'track' in music_tracks equals 'track' in cd_tracks.

Should I be using joinTable or do I have to write custom SQL?

Jim
WebCamp One, LLC



Websites That Work