-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbooks.php
39 lines (31 loc) · 793 Bytes
/
books.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
<?php
$title = 'Books'; include("header.php");
?>
<link rel="stylesheet" href="./css/books.css">
<!-- Type your Code here -->
<h1>Books Page</h1>
<?php
$sql = "SELECT *
FROM Book";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo "
<div class='book'>
<h4>".$row['Book_name']."</h4>
<h4>".$row['price']."</h4>
<img src='./Uploads/Books/". $row['Book_img'] ."' alt='' width='108px' heigth='172.75px'>
<a href='./addToCart.php?Book_ID=".$row['Book_ID']."'>Add to Cart</a>
</div>
<hr>
";
}
}
else {
echo "0 items";
}
?>
<script src="./js/books.js"></script>
<?php
include("footer.php");
?>