如果一對多的話,如下
table--------------------table--------------------table
(user)---------------(shopcart)---------------(shop)
user.id-----> user_id------shop_id--------->shop.id
1 ---------------1---------------1---------------1
2 ---------------1---------------2---------------2
3 ---------------2---------------1---------------1
SELECT * FROM shopcart
INNER JOIN shop on shop_id = shop.id
WHERE user_id=:$SESSION['user]['id'];
找到一個方式以$SESSION儲存過的使用者id來合併尋找