我有3個表及其列。SQL如何在這種特定情況下選擇數據
'players': id
'items': player_id,item_id,quantity
'item_list': id,price
我要選擇列表中的所有項目的運動員有:
("select * from items where player_id=$player_id")
,同時顯示的項目數據形式「的MULTILINE_ACL_COMPONENT」表。輸出應該是這樣的
嗨,我有ID $player_id
。這裏是我的項目
item_id1價格1多少:$數量1
item_id2 price2多少:$ quanity2
等
如何做到這一點?我不想每個查詢我的基地(while $row=mysqli_fetch_array($result)
)。那太重了。我想要做1或2個查詢(union?outer join?inner join?我不知道,我在問),並且他們顯示數據。任何人都知道如何做到這一點?
我把項目,而不是我和item_list而不是il? – user3033026
沒有。我很好。謝謝 – user3033026
eeehh我如何顯示數據?請幫忙 – user3033026