gpt4 book ai didi

php - 表中的动态记录生成。无法正确显示数据

转载 作者:行者123 更新时间:2023-11-29 08:40:06 26 4
gpt4 key购买 nike

我有以下代码,其中数据库表中的数据显示在表中。但2-3条记录后,就无法正常显示记录了。

这是代码:

<tr>
<?php do { ?>
<td>&nbsp;</td>
<td><?php echo $row_Recordset1['notification']; ?></td>
<td><?php echo $row_Recordset1['online_date']; ?></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>

它生成以下输出: My 3rs record's notification is empty, and 4th record is not displaying properly.

行 HTML 输出是:

<form id="form1" name="form1" method="post" action="">
<table width="900" align="center" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="6">&nbsp;</td>
<td colspan="5"><div align="center">Active Notifications </div></td>
<td rowspan="6">&nbsp;</td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
</tr>
<tr>
<td>No.</td>
<td>Notifications</td>
<td>Online Date </td>
<td colspan="2">Transactions</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Our New destinations are Countries.</td>
<td>2012-12-27</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>abcdefgh</td>
<td>2012-12-27</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Hi</td>
<td>2012-12-27</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>hello</td>
<td>2012-12-27</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</form>

最佳答案

您的<tr>标签位于循环外部,而结束标签位于循环内部。

关于php - 表中的动态记录生成。无法正确显示数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14060125/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com