-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateForm.php
41 lines (40 loc) · 1.43 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
<?php
$con=mysqli_connect('localhost','root');
mysqli_select_db($con,'brm_db');
$q="select * from book";
$result=mysqli_query($con,$q);
$num=mysqli_num_rows($result);
mysqli_close($con);
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>View book records</title>
<link rel="stylesheet" href="./css/viewStyle.css">
</head>
<body>
<h1>update Record Managament</h1>
<form class="" action="updation.php" method="post">
<table id="view_table" >
<tr>
<th class="c1" >Book id</th>
<th class="c1" >Title</th>
<th class="c1" >Price</th>
<th class="c1" >Author</th>
</tr>
<?php for ($i=1; $i<=$num ; $i++) {
$row=mysqli_fetch_array($result);
?>
<tr>
<td class="d1"><?php echo $row['bookid']; ?> <input type="hidden" name="bookid<?php echo $i ?>" value="<?php echo $row['bookid']; ?>"> </td>
<td class="d1"><input type="text" name="title<?php echo $i ?>" value="<?php echo $row['title']; ?>"> </td>
<td class="d1"><input type="text" name="price<?php echo $i ?>" value="<?php echo $row['price']; ?>"> </td>
<td class="d1"><input type="text" name="author<?php echo $i ?>" value="<?php echo $row['author']; ?>"> </td>
</tr>
<?php } ?>
</table>
<input type="submit" value="Update">
</form>
</body>
</html>