$row1只是个一维数组,为什么要foreach两次呢?
<html>
<head>
<title>留言板</title>
</head>
<body bgcolor="tan">
<{foreach item=index1 from=$array1}> <{$index1.username}><{/foreach}>
</body>
</html>
<html>
<head>
<title>留言板</title>
</head>
<body bgcolor="tan">
<{foreach item=index1 from=$array1}> <{$index1.username}><{/foreach}>
</body>
</html>
<?php
include('setup.php');
include('connect.php');
$result=mssql_query("select id,username,gettime,content from wapmsg",$db);
while ($row1=mssql_fetch_array($result))
{
echo "查询成功"."<br/>";
$data[$row1["id"]]=$row1;
}
$smarty->assign("array1",$data);
$smarty->display("messege.html");
?>