-
Notifications
You must be signed in to change notification settings - Fork 0
/
display.php
67 lines (58 loc) · 1.8 KB
/
display.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE HTML>
<html>
<style>
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
background-color: wheat;
}
.topnav {
overflow: hidden;
background-color: #333;
}
</style>
<body bgcolor="87ceeb">
<div class="topnav">
<center><h1 style="color:white";>Simple Library Management System</h1></center>
</div>
<br>
<?php
include("DBConnection.php");
//$search = $_REQUEST["search"];
//$query = "select ISBN,Title,Author,Edition,Date from book_info where title like '%$search%'"; //search with a book name in the table book_info
$query = "select ISBN,Title,Author,Edition,Date from book_info";
$result = mysqli_query($db,$query);
if(mysqli_num_rows($result)>0)if(mysqli_num_rows($result)>0)
{
?>
<table border="2" align="center" cellpadding="5" cellspacing="5">
<tr>
<th> ISBN </th>
<th> Title </th>
<th> Author </th>
<th> Edition </th>
<th> Date </th>
<th> Delete </th>
<th>Update</th>
</tr>
<?php while($row = mysqli_fetch_assoc($result))
{
?>
<tr>
<td><?php echo $row["ISBN"];?> </td>
<td><?php echo $row["Title"];?> </td>
<td><?php echo $row["Author"];?> </td>
<td><?php echo $row["Edition"];?> </td>
<td><?php echo $row["Date"];?> </td>
<td><a href="delete.php?id=<?php echo $row['ISBN']; ?>" style="color:red;">Delete</a></td>
<td><a href="update.php?id=<?php echo $row['ISBN']; ?>" style="color:red;">Update</a></td>
</tr>
<?php
}
}
else
echo "<center>No books found in the library by the name $search </center>" ;
?>
</table>
</body>
</html>