-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupadate_view.php
40 lines (31 loc) · 1.01 KB
/
upadate_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
<?php
$host = 'localhost';
$user = 'root';
$pass = '';
$dbname = 'option_DB';
$conn = mysqli_connect($host, $user, $pass, $dbname);
if (!$conn) {
die('Could not connect: ' . mysqli_connect_error());
}
$id = $_GET['id'];
$query = "SELECT * FROM `option` WHERE id = '$id'";
$result = mysqli_query($conn, $query);
$row = mysqli_fetch_array($result)
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Update Option</title>
</head>
<body>
<h2 align="center">Update Option</h2>
<form method="post" action="update.php?id=<?php echo ($row['id']); ?>" align="center">
Option#: <input type="text" name="option" value="<?php echo $row['option'] ?>"></br></br>
Type: <input type="text" name="type" value="<?php echo $row['type'] ?>"></br></br>
Name: <input type="text" name="name" value="<?php echo $row['name'] ?>"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>