Usually I'm good at resolving questions like this, but I just can't get my head around this one. I need the right approach if anyone can point the way.
I have a main table and 4 other tables which are linked with foreign keys. Since the linked tables can each have from 1 to 20 records linking to any one record on the main table, my query returns a huge matrix of results. For example:
main.id---tbl1---tbl2---tbl3
1----------1-----1-----1
1----------1-----1-----2
1----------1-----1-----3
1----------1-----2-----1
1----------1-----2-----2
1----------1-----2-----3
(and so on...)
How am I to echo the results where I'd show only one html table for each main.id and have a cell with all the tbl1 entries, a cell with tbl2 entries, tbl3 entries, etc.?
I don't know how to loop through the results to put each linked table's values into an array. Or, I do, but it sure seems complex.
Any tips or advice?
Thanks,
4string