怎么不能循环输出?()smarttemplate 劳叨请进

kkobebryant 2004-12-06 10:05:15
主程序:
$text=array();

while ($arr=mysql_fetch_assoc($result["res"]))
{


$text=array(
"examID"=>$arr["id"],
"examName"=>$arr["examName"],
"examType"=>$arr["examType"],
"examCY"=>$arr["examCY"],
"examAdd"=>$arr["examAdd"],
"examDate"=>$arr["examDate"]);



}

$ksgl->assign("row",$text);
$ksgl->output();



<!-- BEGIN row -->
<tr id=tr{examID} onmouseover=changeColor1('tr{examID}') onmouseout=changeColor2('tr{examID}') onclick=showBook('{examID}') bgcolor=#ddeeff>
<td align=center class=f2 width=3% id=td{examID}>
<img src=images/green_arrow.gif>
</td>
<td align=left class=f2 width=16% valign=bottom>{examName}</td>
<td align=center class=f2 width=19%>{examType}</td>
<td align=center class=f2 width=19%>{examCY}</td>
<td align=center class=f2 width=19%>{examAdd}</td>
<td align=center class=f2 width=11%>{examDate}</td>
<td align=center class=f2 width=5%><img src=images/delete1.gif height=17 align=bottom style=cursor:hand onclick=deleteExam('{examID}')></td>
</tr>
<!-- END row -->



为什么只输出了一行,没有循环的?
...全文
125 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
wxq4100798 2004-12-07
  • 打赏
  • 举报
回复
$text[]=array(
"examID"=>$arr["id"],
"examName"=>$arr["examName"],
"examType"=>$arr["examType"],
"examCY"=>$arr["examCY"],
"examAdd"=>$arr["examAdd"],
"examDate"=>$arr["examDate"]);
就行,你那样只取最后一条记录
erldy 2004-12-07
  • 打赏
  • 举报
回复
GOOD!
jxflll 2004-12-07
  • 打赏
  • 举报
回复
楼上两位说的对。
xuzuning 2004-12-07
  • 打赏
  • 举报
回复
$text=array(
改做
$text[] = array(
ice_berg16 2004-12-07
  • 打赏
  • 举报
回复
$text[]=array(
"examID"=>$arr["id"],
"examName"=>$arr["examName"],
"examType"=>$arr["examType"],
"examCY"=>$arr["examCY"],
"examAdd"=>$arr["examAdd"],
"examDate"=>$arr["examDate"]);
tt007 2004-12-07
  • 打赏
  • 举报
回复
那就用 mysql_fetch_row()试试!!还有你的表格里的行,没有循环进去啊,当然只有一行啊

21,893

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧