Home > php教程 > php手册 > body text

Destoon实现多表查询示例,Destoon实现示例

WBOY
Release: 2016-06-13 09:26:48
Original
2414 people have browsed it

Destoon实现多表查询示例,Destoon实现示例

本文示例可实现Destoon多表查询。在进行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="#" rel="external nofollow" rel="external nofollow" ><img  src="{$v['thumb']}" border="0"    style="max-width:90%"  style="max-width:90%" / alt="Destoon实现多表查询示例,Destoon实现示例" ></a></div><div class="dk1bb_b"><a href="#" rel="external nofollow" rel="external nofollow" >{dsubstr($v['company'],18)}</a></div> 
</li> 
{/loop}

Copy after login

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; 
}

Copy after login

希望本文示例对大家的destoon开发有一定的帮助作用。

destoon双表查询问题教:怎查询文章内容,并保持格式不变

{loop $tags $k $t}

{$t[title]}{$t[content]}{/loop}
 

destoon管理员紧急助,标签说明调用多表的方法


 

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template