<a href="add.php">add new product</a><br>
<br>
<?php
include("mysql.php");
$result = mysql_query("SELECT * FROM gallery ");
$just = mysql_fetch_array($result);
$num=mysql_num_rows($result);
$table="";
$table.="<td>delete</td>";
$table.="<td>update</td>";
if ($num > 0 ) {
$i=0;
while($just = mysql_fetch_array($result))
{
$num=mysql_num_rows($result);
{
$table .= "<tr>";
$table .= "<td><a href=\"delete.php?name=".$just['name']."&id=".$just['id']."\">".$just['title']."</a></td>";
$table .= "<td><a href=\"update.php?description=".$just['description']."&title=".$just['title']."&id=".$just['id']."\">".$just['title']."</a></td>";
}
$table .= "</tr>";
while ($i < $num) {
$name = stripslashes(mysql_result($result,$i,"name"));
$title = stripslashes(mysql_result($result,$i,"title"));
$description = stripslashes(mysql_result($result,$i,"description"));
++$i; }
}
}
else { $table = '<tr><td colspan="2" align="center">Nothing found</td></tr>'; }
?>
<table border="1" cellpadding="1" cellspacing="2"><? echo $table ?></table>
早上好,在上面的代码中,我试图创建一个包含 2 列删除和更新的表,能够通过这个页面管理 mysql,但是我只从 mysql 表中得到 1 行,虽然我希望有 4 行(4 行保存在 mysql 表中)这里有什么问题,在此先感谢