mysql 一個表有多個鍵 對應另一個表的id
兩個表的對應關係:
$user_address=D('UserAddress')->query("SELECT m.id,name,phone,address,m.province,n.areaname,m.city,o.areaname as area2name, m.district,pm.district,c .areaname as area3name FROM `ez_user_address` as m INNER JOIN ez_area as n on m.province=n.id IN遠on m.district=p.id WHERE m.id=1");<br>
// dump($user_address);exit;
列印結果: