我有一个 div 没有被里面的内容下推。相反,内容只是与 div 重叠。我认为这是因为 div 标签之间有一个 PHP while 循环?我该如何解决?
session_start();
if (!$_SESSION["user_name"])
{
header("Location: index.php");
}
include('header.php');
$id = $_GET['id'];
if(isset($id)) {
connect_to_db();
mysql_query("DELETE FROM content WHERE id='$id'");
$deleted = 'Content Successfully Deleted.<br>';
}
echo '<div id="content">';
echo '<h2>Delete Content</h2>';
if(isset($deleted)){
echo $deleted;
}
connect_to_db();
$query="SELECT id, date, title, image FROM content ORDER BY date DESC";
$result=mysql_query($query);
while($row = mysql_fetch_array($result)){
echo '<div id="delete" align="center">';
echo '<a href="delete.php?id='.$row['id'].'"><img src="'.$row['image'].'" style="border:1px solid black; width:100px;"><br>Delete</a>';
echo '</div>';
}
echo '</div>';