1. 读取记录
while($row=mysql_fetch_array($result))
{$record[]=array(
    'title'=>$row['title'],
 'body'=>$row['body'],);
}

$smarty->assign('yes', $record);//传说中的替换变量,即将$record赋给yes

 

2.在前台展示

{foreach item=news from=$yes}
{$news.title}:{$news.body}
<br>
{/foreach}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2021-09-09
猜你喜欢
  • 2021-11-12
  • 2021-08-18
  • 2021-08-05
  • 2021-08-15
  • 2022-12-23
  • 2021-09-09
  • 2021-06-09
相关资源
相似解决方案