Destoon multi-Table query example and Destoon implementation example

Source: Internet
Author: User

Destoon multi-Table query example and Destoon implementation example

In this example, Destoon multi-table queries can be implemented. It is of great practical value in the secondary development of destoon. The specific implementation method is as follows:

1. template file section

The Code is as follows:

<!--{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" ></a></div><div class="dk1bb_b"><a href="#" rel="external nofollow" rel="external nofollow" >{dsubstr($v['company'],18)}</a></div> </li> {/loop}

2. php code

The code for implementing destoon multi-Table query is as follows:

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

I hope this example will help you with destoon development.


Destoon dual-Table query how to query the content of an article and keep the format unchanged

<! -- {Php $ tags = tag ("table = table 1 m, table 2 c & prefix = & condition = m. itemid = c. itemid & order = addtime desc & pagesize = 1 & template = null ");} --> {loop $ tags $ k $ t}

 
The destoon Administrator provides urgent assistance. labels indicate how to call multiple tables.

<! -- {Php $ tags = tag ("table = article_data_21 B, destoon_article_21 a & condition =. itemid = $ itemid and B. itemid = $ itemid & pagesize = 1 & template = null ",-1)} -->
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.