联系官方销售客服
1835022288
028-61286886
模板标签里面
如果多表合并查询 3个以上?
{sql sql='select * from dr_1_zikao union all select * from dr_1_chengkao union all select * from dr_1_zsben union all select * from dr_1_dianda union all select * from dr_1_yuanch' page=1 pagesize=2 urlrule=index.php?s=info&c=category&id=1&page=[page]} <li> <div class="list_l_b_img fl"> <img src="{dr_thumb($t['thumb'], 135, 75)}" alt=""> </div> <div class="list_l_b_tit fl"> <h3><a href="{$t['url']}">{$t['title']}</a></h3> <div class="list_zbrq"> <span>责编:{$t.author}</span> <span>{dr_date($t['_updatetime'], 'Y-m-d')}</span> </div> </div> </li> {/sql}{$debug}
SQL: select * from dr_1_zikao union all select * from dr_1_chengkao union all select * from dr_1_zsben union all select * from dr_1_dianda union all select * from dr_1_yuanch LIMIT 8,2总记录:9分页:已开启当前页:5总页数:5每页数量:2分页地址:index.php?s=info&c=category&id=1&page=[page]可用字段:id、catid、title、thumb、keywords、description、hits、uid、author、status、url、link_id、tableid、inputip、inputtime、updatetime、comments、avgsort、displayorder、related、area
现在只能调出
select * from dr_1_zikao union all select * from dr_1_chengkao 的结果
union all如何多个表合并呢?
<li>
<div class="list_l_b_img fl">
<img src="{dr_thumb($t['thumb'], 135, 75)}" alt="">
</div>
<div class="list_l_b_tit fl">
<h3><a href="{$t['url']}">{$t['title']}</a></h3>
<div class="list_zbrq">
<span>责编:{$t.author}</span>
<span>{dr_date($t['_updatetime'], 'Y-m-d')}</span>
</div>
</div>
</li>
{/sql}{$debug} 这样可以查询 但是 page=1 pagesize=2 urlrule=index.php?s=info&c=category&id=1&page=[page] sql里加这个分页会报一堆错,不用这个sql语句可以查询 也能分页 不知道这里为什么不能分页了