首页上一页 1 下一页尾页 4 条记录 1/1页
请教纯净水老师
发表在PHP图书答疑
2012-08-20
是否精华
是
否
版块置顶:
是
否
我在学习《PHP开发全程实录》第七单的图书管理系统中,遇见一个难题,始终不得其解,就是在那个book.php的文件中加分页功能,一直没有实现。想请纯净水大大帮忙改改看看。学生实在愚笨。万分感谢了!!!
<?php
include("Conn/conn.php");
$query=mysql_query("select book.barcode,book.id as bookid,book.bookname,bt.typename,pb.pubname,bc.name from tb_bookinfo book join tb_booktype bt on book.typeid=bt.id join tb_publishing pb on book.ISBN=pb.ISBN join tb_bookcase bc on book.bookcase=bc.id");
$result=mysql_fetch_array($query);
if($result==false){
?>
<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="36" align="center">暂无图书信息!</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<a href="book_add.php">添加图书信息</a> </td>
</tr>
</table>
<?php
}else{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="87%"> </td>
<td width="13%">
<a href="book_add.php">添加图书信息</a></td>
</tr>
</table>
<table width="98%" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bordercolordark="#D2E3E6" bordercolorlight="#FFFFFF">
<tr align="center" bgcolor="#e3F4F7">
<td width="13%">条形码</td>
<td width="26%">图书名称</td>
<td width="15%">图书类型</td>
<td width="14%">出版社</td>
<td width="12%">书架</td>
<td width="6%">修改</td>
<td width="5%">删除</td>
</tr>
<?php do{ ?>
<tr>
<td style="padding:5px;"> <?php echo $result[barcode];?></td>
<td style="padding:5px;"><a href="book_look.php?id=<?php echo $result[bookid];?>"><?php echo $result[bookname];?></a></td>
<td style="padding:5px;"> <?php echo $result[typename];?></td>
<td style="padding:5px;"> <?php echo $result[pubname];?></td>
<td style="padding:5px;"> <?php echo $result[name];?></td>
<td align="center"><a href="book_Modify.php?id=<?php echo $result[bookid];?>">修改</a></td>
<td align="center"><a href="book_del.php?id=<?php echo $result[bookid];?>">删除</a></td>
</tr>
<?
}while($result=mysql_fetch_array($query));
}
?>
</table>
<?php
include("Conn/conn.php");
$query=mysql_query("select book.barcode,book.id as bookid,book.bookname,bt.typename,pb.pubname,bc.name from tb_bookinfo book join tb_booktype bt on book.typeid=bt.id join tb_publishing pb on book.ISBN=pb.ISBN join tb_bookcase bc on book.bookcase=bc.id");
$result=mysql_fetch_array($query);
if($result==false){
?>
<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="36" align="center">暂无图书信息!</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<a href="book_add.php">添加图书信息</a> </td>
</tr>
</table>
<?php
}else{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="87%"> </td>
<td width="13%">
<a href="book_add.php">添加图书信息</a></td>
</tr>
</table>
<table width="98%" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bordercolordark="#D2E3E6" bordercolorlight="#FFFFFF">
<tr align="center" bgcolor="#e3F4F7">
<td width="13%">条形码</td>
<td width="26%">图书名称</td>
<td width="15%">图书类型</td>
<td width="14%">出版社</td>
<td width="12%">书架</td>
<td width="6%">修改</td>
<td width="5%">删除</td>
</tr>
<?php do{ ?>
<tr>
<td style="padding:5px;"> <?php echo $result[barcode];?></td>
<td style="padding:5px;"><a href="book_look.php?id=<?php echo $result[bookid];?>"><?php echo $result[bookname];?></a></td>
<td style="padding:5px;"> <?php echo $result[typename];?></td>
<td style="padding:5px;"> <?php echo $result[pubname];?></td>
<td style="padding:5px;"> <?php echo $result[name];?></td>
<td align="center"><a href="book_Modify.php?id=<?php echo $result[bookid];?>">修改</a></td>
<td align="center"><a href="book_del.php?id=<?php echo $result[bookid];?>">删除</a></td>
</tr>
<?
}while($result=mysql_fetch_array($query));
}
?>
</table>