-
Notifications
You must be signed in to change notification settings - Fork 0
/
book_list1.php
51 lines (48 loc) · 1.24 KB
/
book_list1.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
$conn = mysql_connect("125.221.225.210:3306","root","88888888");
mysql_select_db("db_BookStore");
mysql_query("set names utf8", $conn);
include("pagination.php");
$class = $_GET['class'];
$sql = "select * from tb_BookInfo where book_Class=$class";
$result = @mysql_query($sql);
if(!mysql_num_rows($result))
{
die("没有该类书籍");
}
?>
<html>
<head>
<title>布谷书城</title>
</head>
<body>
<table>
<tr>
<td>书籍封面</td>
<td>书籍名称</td>
<td>书籍作者</td>
<td>书籍价格</td>
</tr>
<?php
$content = "";
while($bookinfo = @mysql_fetch_array($result))
{
$sql = "select * from tb_BookPrice where book_ID=$bookinfo[0]";
$arr = mysql_query($sql, $conn);
$price = mysql_fetch_array($arr);
$content .= "<tr>
<td><a href='bookInfo.php?bookId=$bookinfo[0]'><img src='http://125.221.225.210/BGbird/images/small-{$bookinfo[5]}' ></a></td>
<td><a href='bookInfo.php?bookId=$bookinfo[0]'>$bookinfo[1]</a></td>
<td>$bookinfo[6]</td>
<td>¥$price[1]</td>
</tr>
";
}
$content .= "</table>";
echo $content;
$sql = "SELECT count(*) as amount FROM tb_BookInfo where book_Class=$class";
$pagination = new Pagination($sql,10);
$pagination->print_pagination();
?>
</body>
</html>