请查看我的代码并帮助我修复代码中的错误。只有我的第一个数据显示在我的视图页面上的表格上,但其他数据显示在视图页面上而不是表格上。
我的图像名称和图像本身已成功插入我的数据库和我命名为“上传”的图像目录,但图像不会显示在我的视图页面上。
<?php
include ("config.php");
// Retrieve data from database
$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
echo "<table border='1'>
<tr>
<th>id</th>
<th>firstname</th>
<th>lastname</th>
<th>address</th>
<th>nationality</th>
<th>accountnumber</th>
<th>accounttype</th>
<th>balance</th>
<th>passport</th>
<th>username</th>
<th>passport</th>
<th>update</th>
<th>delete</th>
</tr>";
while($row = mysql_fetch_array($result)){
echo "<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['firstname'] . "</td>";
echo "<td>" . $row['lastname'] . "</td>";
echo "<td>" . $row['address'] . "</td>";
echo "<td>" . $row['nationality'] . "</td>";
echo "<td>" . $row['account'] . "</td>";
echo "<td>" . $row['accounttype'] . "</td>";
echo "<td>" . $row['balance'] . "</td>";
echo "<td><h1><img src=\"upload/\" height=35 width=35 /> $row[id]</h1></td>";
echo "<td>" . $row['username'] . "</td>";
echo "<td>" . $row['password'] . "</td>";``
echo "<td><a href=\"update.php?id=" . $row['id'] . "\">update</a></td>";
echo "<td><a href=\"delete.php?id=" . $row['id'] . "\">delete</a></td>";
echo "</table>";
// close while loop
}
?>