In 2003 I wrote a patch for 5.4 to do complex table joins. The original thread is at:
http://opensource.platon.sk/forum/projects/viewtopic.php?t=103
I've updated this patch for 5.6. It lives at:
http://inwa.net/~ben/phpmyedit56.multijoin.patch
To explain what this does, imagine my dilemma: I maintain a work scheduling application. The table "staff_to_shift" matches a staff id and a shift id, both of which reference other tables. The referenced shift table in turn references the crew table to get the crew name for the shift. With the basic phpMyEdit functionality, I can replace staff_to_shift.shift_id with "shift.crew_id - shift.start" which looks something like:
| Kód: |
| "22 - 2006-08-17 11:00:00" |
But I want the crew_id replaced with the crew name from the crew table, like this:
| Kód: |
| "Security - 2006-08-17 11:00:00" |
This patch makes it possible to do that. In your config file, after the column definition, add something like:
| Kód: |
// standard phpMyEdit options
$opts['fdd']['shift']['values']['table'] = '2007_shift';
$opts['fdd']['shift']['values']['column'] = 'id';
$opts['fdd']['shift']['values']['description']['columns'][0] = 'crew';
$opts['fdd']['shift']['values']['description']['columns'][1] = 'start';
$opts['fdd']['shift']['values']['description']['divs'][0] = ' ';
// patched phpMyEdit options
$opts['fdd']['shift']['values']['description']['values'][0]['table'] = 'crew';
$opts['fdd']['shift']['values']['description']['values'][0]['column'] = 'id';
$opts['fdd']['shift']['values']['description']['values'][0]['columns'] = 'name';
|
That will replace ['description']['columns'][0] with ['description']['values'][0]['columns'] -- replace 2007_shift.crew with 2007_crew.name. The patch works when viewing or editing records.
I think this patch is useful. I couldn't find any other way to do this. Apologies if I missed something in the docs.
-- Ben
|