多表联系关系调用

WBOY
Release: 2016-06-13 12:36:43
Original
771 people have browsed it

多表关联调用
表 business_circle
字段 id  name  parent_id 

表 goods_area
字段 goods_id  city  area 


$sql = mysql_query("select * from goods_area as a INNER JOIN business_circle as b on a.area=b.name order by a.goods_id asc");
while($rs = mysql_fetch_assoc($sql)){
   echo $rs['area'].$rs['parent_id'].'
';
}




这样能调用处parent_id的值但我想调用出条件parent_id = id表business_circle里的name值

不知道讲的清楚吗?高手直接给完整代码,谢谢了

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!