摘要:
1. 读取记录while($row=mysql_fetch_array($result)){$record[]=array( 'title'=>$row['title'],'body'=>$row['body'],);}$smarty->assign('yes', $record);//传说中的替换变量,即将$record赋给yes2.在前台展示{foreach item=news from=$yes}{$news.title}:{$news.body}{/foreach} 阅读全文