I realize this is an old post and my have been answered somewhere, but since I was trying to do this and this is the post I found in my search, I thought I would post the code that worked for me in case someone else ended up here like me ;-)
Example:
Table categories (PMEtable0)
Table files contains field cid which contains the category record id.
In the config for listing the categories for selection I added this field to display the count of files belonging to each category.
Code: |
$opts['fdd']['virtual_01'] = array(
'name' => 'File Count',
'select' => 'V',
'options' => 'L', // Only list
'maxlen' => 1,
'sort' => false,
'sql' => ' (Select count(fid) from files where cid=PMEtable0.cid)',
'display' => 'V'
);
|
This is working with out CVS version using stable 5.5 release
|