mysql 一个表有多个键 对应另一个表的id
程序员文章站
2022-05-29 17:51:19
...
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");
// dump($user_address);exit;
打印结果:上一篇: shopnc 商城源码阅读笔记(一)
下一篇: PHP 获取二维数组中某个key的集合