<test2.php>
require_once "conn.php";
require_once "smarty_reg.php";
$sql="select * from jinyifang_user_admin";$result=mysql_query($sql);
//将用户表的信息赋给$arr[]数组中
while($rows=mysql_fetch_array($result)){$arr[]=array('id'=>$rows[0],'user_name'=>$rows[1],'user_pwd'=>$rows[2]);
}
$smarty->assign('per',$arr);
$smarty->display('test2.tpl');
<test2.tpl>
<{section name=customer loop=$per}>
<{$per[customer].id}> <{$per[customer].user_name}> <{$per[customer].user_pwd}><br/>
<{/section}>
<hr/>