select ID,Title,PhotoUrl,Score,picturecontent from KS_Photo where tid='{$CurrClassID}' order by id desc
再下一步:写循环体
<div id="photo_box">
[loop=10]
<div class="photo_k">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><div class="photo"><img src="{$Field(PhotoUrl,Text,0,...,0,)}" width="121" height="123"></div></td>
</tr>
<tr>
<td height="22" class="photo_bt">{$Field(Title,Text,20,...,0,)}</td>
</tr>
<tr>
<td class="ps">得票数:{$Field(Score,Num,0,2)} 票</td>
</tr>
<tr>
<td class="imgdps"><a href="/photo/vote.asp?id={$Field(ID,GetInfoUrl,2,2)}"><img src="/images/tp.jpg" border="0"></a></td>
</tr>
</table>
</div>
[/loop]
</div>