The myth of while? How can I make a "only once" object appear only once? Without being affected by other while?

clipboard.png

my question is a bit complicated
the orange line is a while
color line is also a while
film, you can see that it has been duplicated (I use distinct, you can see that there is a problem)

on the right side of the shopping list is to show the name of the store
and then all the goods in the store
, so I have to print each store name
and then print each corresponding store

.

I"m completely stuck here now.
my goal is to print as many items as there are in the line
, but only one object in the color box will be fine!
if there is only one item (offline), then everything will be normal.
but if there are more than one item on the offline line, he will reorder more than one item. There are several identical
I would like to explain how to solve it?
how to write if it is a general way of thinking?

Mar.31,2021

so there is a problem with the sql statement of the query. You should divide it into two queries: one query the data of the outermost while, and one query the while data of the blue picture
query the outermost data is a List, and then store the List information of the picture in a field
-- do not understand PHP, but have the same meaning

.
Menu