例子,Destoon多表查询。
1)、模板文件
复制代码 代码示例:
<!--{php $tags=tag("table=destoon_member m,destoon_company c&prefix=&condition=m.userid=c.userid and c.groupid=17&pagesize=10&template=null");}-->
{loop $tags $v}
<li>
<div class="dk1bb_t"><a href="#"><img src="{$v['thumb']}" border="0" width="120" height="92" /></a></div><div class="dk1bb_b"><a href="#">{dsubstr($v['company'],18)}</a></div>
</li>
{/loop}
2,php代码,destoon多表查询
复制代码 代码示例:
function getSell($uname){
global $db;
$lists = array();
$result = $db->query("SELECT * FROM {$db->pre}sell WHERE username='$uname' limit 0,6");
while($r = $db->fetch_array($result)) {
$lists[] = $r;
}
return $lists;
}