其中zt_news.thumb as aa 的意思是将表zt_news中的字段thumb重命名为aa,这是因为这两个表中有重复的字段thumb,代码如下:
{pc:get sql="SELECT zt_news.*,zt_position_data.*,zt_news.thumb as aa FROM zt_news,zt_position_data where zt_news.catid=2 and zt_position_data.catid=2 and
zt_news.id=zt_position_data.id and zt_position_data.posid=1 order by zt_news.listorder desc" num="2"}
<ul class="lm_0701 f_l">
{loop $data $r}
<li>
<a href="{$r[url]}" target="_blank"><img src="{$r[aa]}" />
<h1>{str_cut($r[futitle],22,'')}</h1>
</a> //Cuoxin.com
</li>
{/loop}
</ul>
{/pc}
大型站长资讯类网站! https://www.0818zz.com