该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
$link=@mysql_connect("localhost","root","") or die("链接数据库报错".mysql_error());
mysql_select_db("school") or die("选择数据库报错".mysql_error());
mysql_query("set names utf8");
$sql = "select * from book order by id limit 0,5";
$result = mysql_query($sql);
/*$pageSize=5;
$pageNum = $_GET['pageNum'];
$sql=mysql_query("select * from book where id limit ".(($pageNum -1)*$pageSize).",".$pageSize);
$info=mysql_fetch_array($sql);*/
//echo $result;
/*while ($row = mysql_fetch_row($result)){
foreach($row as $data){
echo $data.' ';
}
echo '
';
}*/
$data = [];
while($row = mysql_fetch_assoc($result)){
$data[] = $row;
}
?>
编号 | 图书名称 | 出版时间 | 图书定价 | 作者 | 出版社 | 操作 |
<?php echo $item['id'];?> | <?php echo $item['bookname'];?> | <?php echo $item['issue_time'];?> | <?php echo $item['price'];?> | <?php echo $item['author'];?> | <?php echo $item['issue_author'];?> | <?php echo "修改|删除" ?> |