<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>图书</title>
</head>
<body>
<table border=1>
<tr>
<th>图书编号</th>
<th>书名</th>
<th>所属种类</th>
<th>上传封面</th>
<th>作者</th>
<th>出版社</th>
<th>定价</th>
<th>图书简介</th>
<th>入库时间</th>
</tr>
<?php
$conn=mysqli_connect('localhost','root','1234') or die ('连接失败');
mysqli_set_charset($conn,'utf8');
mysqli_select_db($conn,'books') or die ('数据库不存在');
$sql="select * from list";
$result=mysqli_query($conn,$sql);
while ($row=mysqli_fetch_assoc($result)){
echo '<tr>';
foreach($row as $v){
echo "<td>$v</td>";
}
echo '</tr>';
}
?>
</table>
</body>
</html>