-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpdateForm.php
54 lines (44 loc) · 1.45 KB
/
UpdateForm.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
<?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> Update Book Record </title>
<link rel="stylesheet" href="ViewStyle.css" /> <!-- using .css file here -->
</head>
<body>
<h1> Book Record Management </h1>
<form action="Updation.php" method="post">
<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'] ?> <input type="hidden" name="B_ID<?php echo $i; ?>" value = "<?php echo $row['B_ID'] ?>"/> </td>
<td> <input type="test" name="B_Title<?php echo $i; ?>" value = "<?php echo $row['B_Title'] ?>"/> </td>
<td> <input type="number" name="B_Price<?php echo $i; ?>" value = "<?php echo $row['B_Price'] ?>"/> </td>
<td> <input type="test" name="B_Auther<?php echo $i; ?>" value = "<?php echo $row['B_Auther'] ?>"/> </td>
<td> <input type="test" name="B_Addition<?php echo $i; ?>" value = "<?php echo $row['B_Addition'] ?>"/> </td>
</tr>
<?php
}
?>
</table>
<tr> <input type="submit" value="Update" /> </tr>
</form>
Go Back To Hame Page <a style="color: blue" href="index.php">CLICK HERE</a>
</body>
</html>