Home > Backend Development > PHP Tutorial > php多个表查询的问题

php多个表查询的问题

WBOY
Release: 2016-06-23 13:55:24
Original
869 people have browsed it

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

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


回复讨论(解决方案)

这个什么模板,没见过。总之,可以先assign ,在使用。如:
伪代码:
assign  id = $var['id'];  

然后在使用的地方直接用id

这个什么模板,没见过。总之,可以先assign ,在使用。如:
伪代码:
assign  id = $var['id'];  

然后在使用的地方直接用id



之外就不能用了,这个怎么解决

眼熟呢...

 

{$val[id]}
嵌套进来

 

{$val[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