我有5個表,我希望從所有鏈接到一個名爲pubs表的數據。mySQL沒有得到所有記錄
special_offers有3條涉及到酒館 事件有4條涉及到酒館
但是我只取回第一個事件和special_offers。它似乎沒有構成一個多層次的數組。我已經嘗試過加入和內心的聯繫,我不知道可能會出現什麼問題。
SELECT pubs.*, special_offers.*, `events`.*, vote.*
FROM pubs
Inner Join `events`
ON pubs.id = `events`.pubID
Inner Join special_offers
ON pubs.id = special_offers.pubID
Inner Join vote
ON pubs.id = vote.pubID
WHERE pubs.id = 48
下面是print_r的輸出
Array (
[0] => 48
[id] => 1 Harveys
[name] => Harveys
[sun] => 10am-2.30am
[31] => 1
[32] => 4
[special_dayID] => 4
[33] => 48
[pubID] => 48
[34] => 2.50 Drinks
[title] => Kodakid
[35] => All drink 2.50 get them while there hot! or cold!
[desc] => Kodakid are playing!
[36] => 1
[37] => 48
[38] => 2012-04-30
[date] => 2012-04-30
[39] => Kodakid
[40] => & others
[subtitle] => & others
[41] => Kodakid are playing!
[42] => kodakid.jpg
[img] => kodakid.jpg
[43] => 1
[44] => 48
[45] => 3
[price_range] => 3
[46] => 5
[atmosphere] => 5
[47] => 2
[food] => 2
[48] => 4
[service] => 4
[49] => 3
[value] => 3
[50] => Waterford City
[county] => Waterford City)
感謝
可不可以打印print_r輸出? – worenga 2012-04-20 16:04:16
您可以使用blockquote標籤重新格式化輸出嗎?閱讀很痛苦。 – 2012-04-20 16:04:25
謝謝,未來會確認 – 2012-04-20 16:20:39