数据记录集重复区域,代码如下:
<form id="form1" name="form1" method="post" action="" width="800">
<?php do { ?>
<table >
<tr>
<td><?php echo $row_Recordset1['id']; ?></td>
<td><?php echo $row_Recordset1['uname']; ?></td>
<td> <?php echo $row_Recordset1['age']; ?></td>
<td><?php echo $row_Recordset1['sex']; ?></td>
<td><?php echo $row_Recordset1['class']; ?></td>
<td><?php echo $row_Recordset1['math']; ?></td>
<td><?php echo $row_Recordset1['english']; ?></td>
<td><?php echo $row_Recordset1['china']; ?></td>
</tr>
</table>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</form>
不加第二行<?php do { ?>与倒数第二行: <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>时,数据能正常显示,一加之后,出现错误:
Warning: mysql_fetch_assoc(): 4 is not a valid MySQL result resource in D:\phpStudy\WWW\study04\index.php on line 80 问题出现在什么地方?
<form id="form1" name="form1" method="post" action="" width="800">
<?php do { ?>
<table >
<tr>
<td><?php echo $row_Recordset1['id']; ?></td>
<td><?php echo $row_Recordset1['uname']; ?></td>
<td> <?php echo $row_Recordset1['age']; ?></td>
<td><?php echo $row_Recordset1['sex']; ?></td>
<td><?php echo $row_Recordset1['class']; ?></td>
<td><?php echo $row_Recordset1['math']; ?></td>
<td><?php echo $row_Recordset1['english']; ?></td>
<td><?php echo $row_Recordset1['china']; ?></td>
</tr>
</table>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</form>
不加第二行<?php do { ?>与倒数第二行: <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>时,数据能正常显示,一加之后,出现错误:
Warning: mysql_fetch_assoc(): 4 is not a valid MySQL result resource in D:\phpStudy\WWW\study04\index.php on line 80 问题出现在什么地方?
This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used.