-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview_books.php
More file actions
49 lines (42 loc) · 1.1 KB
/
view_books.php
File metadata and controls
49 lines (42 loc) · 1.1 KB
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
<?php
include_once 'header.php';
?>
<table width="1250" align="center" bgcolor="orange">
<tr align="center">
<td colspan="5"><h2>View and Edit Books</h2></td>
</tr>
<tr align="center" bgcolor="green">
<th>ISBN</th>
<th>Title</th>
<th>Author</th>
<th>Price</th>
<th>Edit</th>
<th>Delete</th>
</tr>
<?php
include_once 'includes/dbh-inc.php';
?>
<?php
$get_book = "select * from books";
$run_book = mysqli_query($connection, $get_book);
$i = 0;
while($row_book=mysqli_fetch_array($run_book)){
$book_id = $row_book['id'];
$book_title = $row_book['name'];
$book_author = $row_book['author'];
$book_price = $row_book['price'];
$i++;
?>
<tr>
<td><?php echo $book_id;?></td>
<td><?php echo $book_title;?></td>
<td><?php echo $book_author;?></td>
<td><?php echo $book_price;?></td>
<td><a href="edit_books.php?edit_books=<?php echo $book_id; ?>">Edit</a></td>
<td><a href="delete_book.php?delete_book=<?php echo $book_id;?>">Delete</a></td>
</tr>
<?php } ?>
</table>
<?php
include_once 'footer.php';
?>