The page I'm writing has a query that pulls from three tables. That part is done correctly. Now, I need to list the queried info in a table, so I used a while loop.
For the ease of the reader I wanted to set the table up in a very specific manner, and that's where the problem comes in.
All of the desired information is pulled and ordered correctly, but I'm looking to make the display/layout of said info in a hierarchical format. Meaning I need to show the value of table3.field6 once and all of the info therefrom continuously until it is finished, then move onto the next value for table3.field6.
Visually the information should be like this
TABLE3.FIELD6_1ST VALUE
OUTPUT_1ST VALUE_ROW1_INFO_A
OUTPUT_1ST VALUE_ROW2_INFO_B
ETC...
TABLE3.FIELD6_2ND VALUE
OUTPUT_2ND VALUE_ROW3_INFO_A
OUTPUT_2ND VALUE_ROW4_INFO_B
ETC...
What I get right now is
TABLE3.FIELD6_1ST VALUE OUTPUT_1ST VALUE_ROW1_INFO_A
TABLE3.FIELD6_1ST VALUE OUTPUT_1ST VALUE_ROW2_INFO_B
TABLE3.FIELD6_2ND VALUE OUTPUT_2ND VALUE_ROW3_INFO_A
TABLE3.FIELD6_2ND VALUE OUTPUT_2ND VALUE_ROW4_INFO_B
It displays the value of Table3.field6 with each row output. Should I be using a 'for' statement or stick with 'while' or a combination of the two?
Thank you in advance.