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,p.areaname as area3name FROM `ez_user_address` as m INNER JOIN ez_area as n on m.province=n.id INNER JOIN ez_area as o on m.city=o.id INNER JOIN ez_area as p on m.district=p.id WHERE m.id=1");<br>
// dump($user_address);exit;
打印结果: