怎么根据smarty模板中定义的数字获取相应的新闻条数?
刚接触smarty模板,想在模板中控制显示的新闻条数,如下显示5条新闻
<ul><br />{section name=news loop=$arr max=5}<br /> <li>{$arr[news].title}</li><br />{/section}<br /></ul><br />
SELECT id, title, wdate FROM news ORDER BY id DESC LIMIT 0, 5
SELECT id, title, wdate FROM news ORDER BY id DESC