【发布时间】:2015-06-03 07:39:15
【问题描述】:
这是我的 PHP 代码(返回具有 2 列的行的查询:ReportId 和 MailingFrequency):
while($x=mysql_fetch_assoc($result1))
{
$X[0] = $x['ReportId'];
$X[1] = $x['MailingFrequency'];
$X[2] = 'Stop Subscription';
$this->smarty->assign("X", $X);
}
我的 HTML 代码(显示 smarty 变量 X 的数据):
{section name=index loop = $X}
<tr>
<td width="25%">{$X[0]}</td>
<td width="35%">{$X[1]}</td>
<td width="40%"><a href="../webadmin/stopsubscription" id="StopSubscription" style="color: #CC0000">{$X[2]}</a></td>
</tr>
现在,如果数据集只有一行格式(ReportId,MailingFrequency),例如(1,'Saturday'),它可以正确显示。但是,在多行的情况下,仅显示最后一行。 如何显示html表格中的所有行?
【问题讨论】:
标签: php html mysql html-table smarty