Home  >  Article  >  Backend Development  >  php多个表查询的有关问题

php多个表查询的有关问题

WBOY
WBOYOriginal
2016-06-13 11:59:54975browse

php多个表查询的问题

<!--{eval $mythread1 = DB::fetch_all('select * from '.DB::table('attachment')." where tid = $tid");}--><br /><br /><!--{loop $mythread1 $key $val}--><br />{$val[id]}<br /><!--{/loop}-->

如何把第一个表读出来的数据放到给第二个用,上边循环出来的id,放到第二个的这里
<!--{eval $mythread = DB::fetch_all('select * from '.DB::table('attachment_这里')." where tid = $tid");  }--><br /><br /><!--{loop $mythread $key $val}--><br />{$val[name]}<br />       <!--{/loop}-->

------解决方案--------------------
眼熟呢...

 

{$val[id]}
嵌套进来

 

{$val[name]}
       

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