Home >php教程 >php手册 >Mysql A table has multiple keys corresponding to the id of another table

Mysql A table has multiple keys corresponding to the id of another table

WBOY
WBOYOriginal
2016-08-27 08:53:181147browse

Mysql has multiple keys in one table that correspond to the id of another table
Correspondence between the two tables:
Mysql A table has multiple keys corresponding to the id of another table
Mysql A table has multiple keys corresponding to the id of another table$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;Print result:
Mysql A table has multiple keys corresponding to the id of another table

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn