您好,我尝试进行类似我的查询:
result = mysql_query('SELECT subitems.ItemID, subitems.Parent, subitems.Data, items.ID FROM subitems INNER JOIN items ON items.ID = subitems.ItemID WHERE subitems.ItemID = \''. $item['ID'] .'\' GROUP BY subitems.Parent ASC, subitems.Data ASC');
大批 (
[ItemID] => 1
(
[Parent] => 1
(
[Data] => 1
[Data] => 2
[Data] => 3
)
)
[ItemID] => 1
(
[Parent] => 2
(
[Data] => 1
[Data] => 2
[Data] => 3
)
)
)
我尝试为查看 itemID 的每个父项创建一个 foreach 并按父项显示每个项,但不是每次都重写父项的名称。谢谢