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