-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathView.php
48 lines (41 loc) · 1.02 KB
/
View.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
<?php
require('mysql.php');
$q1 = "select * from Book";
$result = mysqli_query($conn, $q1);
$num = mysqli_num_rows($result); //to get to know how much rows in $result
mysqli_close($con);
?>
<!DOCTYPE html>
<html>
<head>
<title> View Book Record </title>
<link rel="stylesheet" href="ViewStyle.css" /> <!-- using .css file here -->
</head>
<body>
<h1 style="color: blue"> Book Record Management </h1>
<table id = "view_table">
<tr>
<th> B_ID </th>
<th> B_Title </th>
<th> B_Price </th>
<th> B_Auther </th>
<th> B_Addition </th>
</tr>
<?php
for($i = 1; $i <= $num; $i++ ) {
$row = mysqli_fetch_array($result);
?>
<tr>
<td> <?php echo $row['B_ID'] ?> </td>
<td> <?php echo $row['B_Title'] ?> </td>
<td> <?php echo $row['B_Price'] ?> </td>
<td> <?php echo $row['B_Auther'] ?> </td>
<td> <?php echo $row['B_Addition'] ?> </td>
</tr>
<?php
}
?>
</table>
Go Back to Home Page <a style="color: blue" href="index.php">CLICK HERE</a>
</body>
</html>