81 Posts
squareweb
3 years ago
Topic

Hi,

I'd like to show total number of children per Parent(row) in my parent-search & list-form. I've bought SQL-pack to "fix" this but I guess this will not work but I'm not shure. I'd like to address the seblod-field-name in the query... Is this possible? See my query below:

SELECT count(*) FROM #__content WHERE catid = 20 and [seblod-fieldname] = $uri->get('someUrlValue')

Hope this is possible and if so, whats the syntax for the [seblod-fieldname]


Thanks in advance.


Mark

Get a Book for SEBLOD
81 Posts
squareweb
3 years ago
0
Level 1

Fixed this one by using the corresponding seblod table. In my case I used:

SELECT count(*) FROM #__cck_store_form_trajectdeel where td_parentid = $cck->getValue('tr_id');

or more universal (fill in your names):

SELECT count(*) FROM #__cck_store_form_[your-content-name] where [your-parent-ID-name] = $cck->getValue([your-row-fieldname]);

The above select will retrieve the number of child-rows per parentID

Get a VIP membership