//代码解析: <!--{eval $slides = DB::fetch_all("SELECT * FROM pre_common_block_item WHERE bid=15 ORDER BY displayorder ASC,id DESC LIMIT 0, 10");}--> <!--{loop $slides $slide}--> <a href="$slide[url]" target="_black"><img src="data/attachment/$slide[thumbpath]" width="300" height="450" alt="$slide[title]"></a> <!--{/loop}--> <!--{eval $slides = DB::fetch_all(" //执行SQL语句 SELECT * //读取全部字段 FROM pre_common_block_item //数据表 可以自定义 这个是DIY帖子内容表 WHERE bid=15 //查询条件 BID 是DIY的模块id ORDER BY displayorder ASC,id DESC //排序条件 LIMIT 0, 10 //获取前10条信息 ");}--> < !–{loop $slides $slide}–> //循环 $slides 数组 使用 $slide[字段名] 获取内容 <a href="$slide[url]" target="_black"><img src="data/attachment/$slide[thumbpath]" width="300" height="450" alt="$slide[title]"></a> < !–{/loop}–>