-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_key.php
More file actions
63 lines (49 loc) · 1.42 KB
/
edit_key.php
File metadata and controls
63 lines (49 loc) · 1.42 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
include_once 'header.php';
include_once 'includes/dbh-inc.php';
if(isset($_GET['edit_key'])){
$get_id = $_GET['edit_key'];
$get_key = "select * from keywords where bookid = '$get_id'";
$run_key = mysqli_query($connection, $get_key);
$i = 0;
$row_key=mysqli_fetch_array($run_key);
$book_key = $row_key['keyword'];
$book_id = $row_key['bookid'];
}
?>
<html>
<head>
<title>Update Key</title>
</head>
<body bgcolor="blue">
<form action="" method="post" enctype="multipart/form-data">
<table align="center" width="600" border="2" bgcolor = "white">
<tr align = "center">
<td colspan="8"><h2>Edit Keyword </h2></td>
</tr>
<tr>
<td align ="center">Keyword:</td>
<td><input type="text" name="keyword" value="<?php echo $book_key;?>" /></td>
</tr>
<tr>
<td align ="center">BookID:</td>
<td><input type="text" name="bookid" value="<?php echo $book_id;?>" /></td>
</tr>
<tr align="center">
<td colspan="8"><input type="submit" name="update_key" value="Update Now" /></td>
</tr>
</table>
</form>
</body>
</html>
<?php
if(isset($_POST['update_key'])){
$book_key = $_POST['keyword'];
$book_keys = $book_id;
$update_keys = "update keywords set keyword='$book_key' where bookid ='$book_keys'";
$run_keys = mysqli_query($connection, $update_keys);
}
?>
<?php
include_once 'footer.php';
?>