Hi Bob & Max and everybody,
I have a connection with two tables: one is the main, the second is related with an hasMany relation because two ore more records are connected by a foreign key with an element of the first table.
The connection is ok.
But i have problem to display multiple records. In the "Front list->Settings (display type Table)" i have some columns with their value from the main table (they are ok). Then I create a column for display datas from the second table and in every row I would display one or more value but I can't.
I read many topic so I try many code but nothing works for me:
if in HTML box I try
the result is: "array (0 => 'element1', 1=> 'element2'...)" instead of "elment1, element2, ..." (that is what I really want).
if in PHP functions box i put
the result is only the last element, so I've try a foreach loop:
but the result is the same: only the last element.
Another info: if in the "Fron list->Actions->view" i put a classic php foreach loop like
i see every fields (without comma :? ).
Can you guys give me a hand (and forgive me for my english)?
I have a connection with two tables: one is the main, the second is related with an hasMany relation because two ore more records are connected by a foreign key with an element of the first table.
The connection is ok.
But i have problem to display multiple records. In the "Front list->Settings (display type Table)" i have some columns with their value from the main table (they are ok). Then I create a column for display datas from the second table and in every row I would display one or more value but I can't.
I read many topic so I try many code but nothing works for me:
if in HTML box I try
Model.field:{Model.[n].field}
the result is: "array (0 => 'element1', 1=> 'element2'...)" instead of "elment1, element2, ..." (that is what I really want).
if in PHP functions box i put
Model.field: return $row ['Model'][0]['field']
the result is only the last element, so I've try a foreach loop:
Model.field: foreach ($row['Model'] as $k => $v) {return $v['field'];}
but the result is the same: only the last element.
Another info: if in the "Fron list->Actions->view" i put a classic php foreach loop like
<?php foreach ($row['Model'] as $k => $v) {echo $v['field'];}?>
i see every fields (without comma :? ).
Can you guys give me a hand (and forgive me for my english)?
Hi Pigna,
Apologies for the late reply!
Did you manage to solve this ? I would suggest using Connectivity v6
Best regards
Apologies for the late reply!
Did you manage to solve this ? I would suggest using Connectivity v6
Best regards
Hi Max!
No, I don't solve it. Now I don't have time to migrate all the project to CC6 & CF6, it's to big (many dynamic fields, multiplier, models and db tables). I found an acceptable balance between the features of V5 and my needs.
I've scheduled an upgrade of the project during next year and then probably I will pass to V6, so I've time to study it.
Thanks anyway!
p.
No, I don't solve it. Now I don't have time to migrate all the project to CC6 & CF6, it's to big (many dynamic fields, multiplier, models and db tables). I found an acceptable balance between the features of V5 and my needs.
I've scheduled an upgrade of the project during next year and then probably I will pass to V6, so I've time to study it.
Thanks anyway!
p.
This topic is locked and no more replies can be posted.